Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Problem with the file format xlCSV and a field separator

When I save a sheet using File - Save as.. to a format CSV - the result
looks OK and like this using Notespad:
1;monday;jan;1,11
2; tuesday;feb;2,22

BUT when I'm using a simple marco for the same funtion, the result looks
like this:
1,monday,jan,1.11
2,tuesday,feb,2.22

Why are the field separators different doing function manual or using marco?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Problem with the file format xlCSV and a field separator

Basically VBA uses US English settings.


If you are using a later version of excel, you might look at the LOCAL
argument to SAVEAS:

From Help on SAVEAS:

Local Optional Variant. True saves files against the language of Microsoft
Excel (including control panel settings). False (default) saves files
against the language of Visual Basic for Applications (VBA) (which is
typically US English unless the VBA project where Workbooks.Open is run from
is an old internationalized XL5/95 VBA project).



Believe this was added in xl2002 and later.

--

Regards,

Tom Ogilvy



"sarimari" wrote in message
...
When I save a sheet using File - Save as.. to a format CSV - the result
looks OK and like this using Notespad:
1;monday;jan;1,11
2; tuesday;feb;2,22

BUT when I'm using a simple marco for the same funtion, the result looks
like this:
1,monday,jan,1.11
2,tuesday,feb,2.22

Why are the field separators different doing function manual or using

marco?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Problem with the file format xlCSV and a field separator

if you have xlXP or newer:
use local:=true in the saveas statement.

when saving files from the UI this argument is true,
whereas from VBA it defaults to false...

same goes for OpenText



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


sarimari wrote :

When I save a sheet using File - Save as.. to a format CSV - the
result looks OK and like this using Notespad:
1;monday;jan;1,11
2; tuesday;feb;2,22

BUT when I'm using a simple marco for the same funtion, the result
looks like this:
1,monday,jan,1.11
2,tuesday,feb,2.22

Why are the field separators different doing function manual or using
marco?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Problem with the file format xlCSV and a field separator

Thank you so, it worked :)
-sarimari

"Tom Ogilvy" kirjoitti:

Basically VBA uses US English settings.


If you are using a later version of excel, you might look at the LOCAL
argument to SAVEAS:

From Help on SAVEAS:

Local Optional Variant. True saves files against the language of Microsoft
Excel (including control panel settings). False (default) saves files
against the language of Visual Basic for Applications (VBA) (which is
typically US English unless the VBA project where Workbooks.Open is run from
is an old internationalized XL5/95 VBA project).



Believe this was added in xl2002 and later.

--

Regards,

Tom Ogilvy



"sarimari" wrote in message
...
When I save a sheet using File - Save as.. to a format CSV - the result
looks OK and like this using Notespad:
1;monday;jan;1,11
2; tuesday;feb;2,22

BUT when I'm using a simple marco for the same funtion, the result looks
like this:
1,monday,jan,1.11
2,tuesday,feb,2.22

Why are the field separators different doing function manual or using

marco?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Problem with the file format xlCSV and a field separator

Thank you, the problem is solved :)
Have a great weekend!
-sarimari

"keepITcool" kirjoitti:

if you have xlXP or newer:
use local:=true in the saveas statement.

when saving files from the UI this argument is true,
whereas from VBA it defaults to false...

same goes for OpenText



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


sarimari wrote :

When I save a sheet using File - Save as.. to a format CSV - the
result looks OK and like this using Notespad:
1;monday;jan;1,11
2; tuesday;feb;2,22

BUT when I'm using a simple marco for the same funtion, the result
looks like this:
1,monday,jan,1.11
2,tuesday,feb,2.22

Why are the field separators different doing function manual or using
marco?


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
format a right justified zero filled field to a prn file right justified and zero filled (excel) Excel Worksheet Functions 4 July 23rd 08 06:07 PM
How do I save a 689 character fixed field/record format file Mike Excel Discussion (Misc queries) 1 July 23rd 08 12:22 AM
FileFormat:=xlCSV for a cell with =TODAY() gives unwantedamerican Crewman Excel Programming 4 March 5th 05 06:18 PM
how to format excel format to text format with separator "|" in s. azlan New Users to Excel 1 January 31st 05 12:57 PM
Change of field separator Janepige Excel Discussion (Misc queries) 1 December 13th 04 02:45 PM


All times are GMT +1. The time now is 08:18 AM.

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"