![]() |
Trouble with csv export...
Hello,
I have some trouble with the csv export of an Excel document using VBA. When I save the document on a German computer using the command below it seperates the cells by semicolon, but if I do this no an English machine (XP, Office 2003) it uses comma insead. Why? And is there an easy workaround? Regards, Thomas ActiveWorkbook.SaveAs Filename:=Pfad_Datei, FileFormat:=xlNormal, CreateBackup:=False ' |
Trouble with csv export...
Thomas,
I believe Excel uses the ListSeparator that is defined in the Windows Regional And International Settings. Debug.Print Application.International(xlListSeparator) I don't think you can change what is used for CSV without changing the Windows Setting, which will affect all applications, not just your current session of Excel. You could roll your own SaveAsCSV procedure using the code in the "Export To Text Files" section on http://www.cpearson.com/excel/imptext.htm . -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email on the web site) "Thomas Sedlaczek" <Thomas wrote in message ... Hello, I have some trouble with the csv export of an Excel document using VBA. When I save the document on a German computer using the command below it seperates the cells by semicolon, but if I do this no an English machine (XP, Office 2003) it uses comma insead. Why? And is there an easy workaround? Regards, Thomas ActiveWorkbook.SaveAs Filename:=Pfad_Datei, FileFormat:=xlNormal, CreateBackup:=False ' |
Trouble with csv export...
I'd rename the file to .txt
Then use file|open. You'll see the text to columns wizard open up and you can specify delimited by a semicolon. You could also change your windows regional settings list separator to semicolon. Thomas Sedlaczek wrote: Hello, I have some trouble with the csv export of an Excel document using VBA. When I save the document on a German computer using the command below it seperates the cells by semicolon, but if I do this no an English machine (XP, Office 2003) it uses comma insead. Why? And is there an easy workaround? Regards, Thomas ActiveWorkbook.SaveAs Filename:=Pfad_Datei, FileFormat:=xlNormal, CreateBackup:=False ' -- Dave Peterson |
Trouble with csv export...
Ignore that first portion of my reply. That showed how to import the file--not
export. But you can change the list separator. Thomas Sedlaczek wrote: Hello, I have some trouble with the csv export of an Excel document using VBA. When I save the document on a German computer using the command below it seperates the cells by semicolon, but if I do this no an English machine (XP, Office 2003) it uses comma insead. Why? And is there an easy workaround? Regards, Thomas ActiveWorkbook.SaveAs Filename:=Pfad_Datei, FileFormat:=xlNormal, CreateBackup:=False ' -- Dave Peterson |
Trouble with csv export...
Thank you Chip!
Well it seams that I have to put some code together. Suddenly the TextCodepage argument of the SaveAs methode is not used in the English Excel version. *arg* Thanks anyway! Thomas "Chip Pearson" wrote: Thomas, I believe Excel uses the ListSeparator that is defined in the Windows Regional And International Settings. Debug.Print Application.International(xlListSeparator) I don't think you can change what is used for CSV without changing the Windows Setting, which will affect all applications, not just your current session of Excel. You could roll your own SaveAsCSV procedure using the code in the "Export To Text Files" section on http://www.cpearson.com/excel/imptext.htm . -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email on the web site) "Thomas Sedlaczek" <Thomas wrote in message ... Hello, I have some trouble with the csv export of an Excel document using VBA. When I save the document on a German computer using the command below it seperates the cells by semicolon, but if I do this no an English machine (XP, Office 2003) it uses comma insead. Why? And is there an easy workaround? Regards, Thomas ActiveWorkbook.SaveAs Filename:=Pfad_Datei, FileFormat:=xlNormal, CreateBackup:=False ' |
All times are GMT +1. The time now is 06:38 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com