Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Udo Udo is offline
external usenet poster
 
Posts: 48
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
Udo Udo is offline
external usenet poster
 
Posts: 48
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving file using data from worksheet Patrick Simonds Excel Programming 1 October 13th 05 05:40 AM
Saving Excel file w/o any data PP Excel Programming 4 August 12th 05 05:20 PM
saving dbf file without losing data govworker Excel Discussion (Misc queries) 0 February 7th 05 11:27 PM
Saving a column of data in another file format Hari Prasadh Excel Programming 12 February 1st 05 03:07 AM
Close file without saving data ExcelMonkey[_96_] Excel Programming 2 March 2nd 04 11:34 PM


All times are GMT +1. The time now is 03:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"