473,545 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1108
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.publi c.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
5129
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 probleme? To export my tables i use folowing code: StTotaal = stLocatieName & "\Archief\" & Year(Date) & Month(Date) & Day(Date) & "_Gegevens.xls" ...
1
6312
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 right-centered when it is correctly validated, apprently excel doesnt recognize the numbers with coma and it is not possible to calculate formulas...
8
161623
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 me up when I need to read the data back. When I run into this problem using Excel interactively I simply change the cell Number format from...
8
13206
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. These queries have memo fields in them Each memo field is trunkated, i.e cuts off after 255 characters. Is there any way either via VBA or...
0
1596
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 being converted to a number field. For example one value in a string field is "0008" and when I export into excel it turns into 8. I know when I...
1
9757
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 having I'd be most appreciative. The database is already constructed, I'm just wanting to export the data to an excel file. In short, I'm hoping...
5
10282
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 = CurrentProject.Path & "\Adhoc_Report.xls" 'New workbook object Dim sh As Workbook DoCmd.OutputTo acOutputTable, "test2",...
0
860
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 properly and everything is alright (I make some calls from within my code to the Excel Interop) I Couldn't find any call that will allow me to set...
6
1952
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 come across this and can point me in the right direction I would appreciate it. Thanks! -- ****************** Reggie
0
7459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7653
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7803
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7411
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5965
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5322
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4942
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3444
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3439
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.