Saving data as *.txt file

U

Udo

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
 
D

Dave Peterson

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?
 
U

Udo

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top