This content has been marked as final. Show 4 replies
What format are you writing? Native Excel, XML, HTML-Table, ...
i am writing html table.
It depends on the version of Excel. Some of the latest versions you can enclose the data in double quotes and precede the first digit with a space. Older versions of Excel I have found no way to solve this issue -- they always look at the data as a number.
You can use cascading styleshees (CSS) to force newer versions of excel to treat the data as different types (text, numeric, etc). Create an example of the file you want to write, save as HTML and then take a look at the stylesheet information on the resulting file. I don't remember off the top of my head what the exact CSS property is to force Excel to treat it as text, but you should be able to figure it out by process of elimination.