Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving data as *.txt file
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving data as *.txt file
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? Udo wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving data as *.txt file
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. 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? Udo wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saving file using data from worksheet | Excel Programming | |||
Saving Excel file w/o any data | Excel Programming | |||
saving dbf file without losing data | Excel Discussion (Misc queries) | |||
Saving a column of data in another file format | Excel Programming | |||
Close file without saving data | Excel Programming |