Excel Column Formatting Question

g-nf-5

New Member
I have an app that is creating an Excel file for import into another process that is giving me fits. Our items are alpha, and when I export an item that is all numerical with leading zeroes. the zeroes are dropped. What command would I need so that the column realizes the values to be text instead of general?
 

mosfin

Member
maybe you can try and export them as string (i.e: enclose with ")
or prefix them with single quote '
(AFAIK Excel treats number that prefixed with single-quote as string)
 

D.Cook

Member
Wow thanks tamhas, this library looks extremely useful, especially allowing us to export reports on a unix server!


What command would I need so that the column realizes the values to be text instead of general?
You can set the cell format to text with the following command. Although note that Excel may display a warning about numeric values stored as text (this warning could be disabled programmatically but I forget how).
Code:
chExcelWorksheet:Columns("A:B"):NumberFormat = "@"
 

jmac13

Member
Personally id format the cells/column to the number format i want.. rather than turning it into a string

e.g.
chWorkSheet:Range(w-chrRange):numberformat = "##,###,##0.00"
 
Top