By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,630 Members | 1,010 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,630 IT Pros & Developers. It's quick & easy.

Export to Excel truncates numbers

P: n/a
Hi and TIA! I'm exporting a dataset/datgrid to excel but some text fields
get converted to numbers in excel and I loose leading zero's. I've tried
several methods with no success. If anyone has come across this and can
point me in the right direction I would appreciate it. Thanks!

--

******************
Reggie
Jul 13 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Reggie wrote:
Hi and TIA! I'm exporting a dataset/datgrid to excel but some text fields
get converted to numbers in excel and I loose leading zero's. I've tried
several methods with no success. If anyone has come across this and can
point me in the right direction I would appreciate it. Thanks!
I'm setting followups for this question to microsoft.public.excel since this
is not a .NET-specific question.

The way to avoid is is to ensure that you are actually writing the data as
text. In formula form, it should be ="00123" and not =00123, for example.
How you do this depends on how you're doing the export. For automation, you
can use the "Formula" property of a Range object, for export, you're
probably best off with XML, as you can't specify data types in CSV.

--
J.
Jul 13 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.