473,395 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Export to Excel truncates numbers

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
1 862
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Keon | last post by:
Hoi, I'm using a database with alot of records in 1 table (more than 3000). If i want to export this table to excel i only get it till record 2385. Do someone know how i can solve this...
1
by: Julien | last post by:
Hi, I'm actually trying to export a repeater to excel, everything seems ok but the problem is that the cells are not validated This means that for example date, it is left-centered instead of been...
8
by: John Brock | last post by:
I am creating an Excel workbook using VB.NET, and have run into a problem. Excel at times insists on reformatting data that I enter into cells, e.g., converting "01234" to "1234", and this screws...
8
by: Taffman | last post by:
I've searched this goup for an answer to this, there are many discussions that come close but non that I can find that actually addresses this particular problem. I'm exporting queries to Excel....
0
by: Jerry | last post by:
I have an application that is trying to export multiple datasets to and excel workbook in different worksheets. I have gotten the export to work except for string fields that happen to be numbers...
1
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm...
2
by: mccalla | last post by:
Hi, I am very new to MS Access. I have inherited an existing app which was done in MS Access 2003. In this app, there is a report which contains a memo field. There are no formats, functions,...
5
Shakss2
by: Shakss2 | last post by:
Hi... I am exporting some data from a table with a memo field to excel but the excel report truncates the memo field data to 255 chars. Dim strPath As String ' Current path strPath =...
0
by: yoavyoavyoav | last post by:
Hi There, I have some serious issue - I have a .Net application that is generating various reports in CSV format and then fires up excel from code to view this file. The file is viewed...
1
by: Reggie | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.