Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2007

Tip: Looking for answers? Try searching our database.

Saving data as *.txt file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Udo - 22 Jan 2007 13:51 GMT
Dear Excellences,

we have an Excel table wich is modified via VBA code. This works
perfectly. At the end, this table has to be saved as *.txt file. When I
do this manually, I can retrieve the table easily. Especially, the
values in the last column, wich are comma (!) separated decimals, are
shown as comma separated decimals again. But when I let the code do the
saving for me with

ActiveWorkbook.SaveAs Filename:="C:\Temp\Cora Act" & ActMon & ".txt",
FileFormat:= _
       xlText, CreateBackup:=False

then these numbers are modified in a way, that the commas are
eliminated. The effect is then, that the numbers are multiplied by 10
times the places after the comma. In some cases, in additin the number
is shown as text and it can't be converted into a number again (e.g.
using =value(B10)).

Any hint how to persuade VBA to properly save the data is appreciated.

Thanks in advance
Udo
Dave Peterson - 22 Jan 2007 15:23 GMT
I just tried a simple test and looked at my output in NotePad.  It looked fine.

Does your data look ok in NotePad?

What kind of data entries do you have in that column?

If you post a little sample, maybe some people will test it.

And what version of excel are you using?
What do you use for a decimal point and what do you use for a thousands
separator?

> Dear Excellences,
>
[quoted text clipped - 19 lines]
> Thanks in advance
> Udo

Signature

Dave Peterson

Udo - 22 Jan 2007 16:58 GMT
You are right, when I have a look at the data in NotePad, they look
correct. Here are examples of these data:
DRD 64007    EUR    13.85778
DRD 64008    EUR    216.175
DRD 64009    EUR    79.304
DRD 64010    EUR    49.17

When I load them into another application (the real target application
or Excel), the decimal separator here is not accepted and the forth
entry is not recognized as number any more.

I'm using Excel 2000, the decimal point is a comma (,) and the
thousands separator is a point (.) - European standard. I think the
different handling of separating the decimals is the crucial part of
this problem.

Dave Peterson schrieb:

> I just tried a simple test and looked at my output in NotePad.  It looked fine.
>
[quoted text clipped - 31 lines]
> > Thanks in advance
> > Udo
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.