Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
format a right justified zero filled field to a prn file | Excel Worksheet Functions | |||
How do I save a 689 character fixed field/record format file | Excel Discussion (Misc queries) | |||
FileFormat:=xlCSV for a cell with =TODAY() gives unwantedamerican | Excel Programming | |||
how to format excel format to text format with separator "|" in s. | New Users to Excel | |||
Change of field separator | Excel Discussion (Misc queries) |