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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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 '



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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


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
Export Excel tuncating leading zeros while export to excel from da RHBKV Setting up and Configuration of Excel 1 July 15th 09 01:48 PM
Chart.Export images are shrinking as I export more images Jared Charts and Charting in Excel 3 January 29th 08 03:23 AM
export re-order input fields to export file [csv] madisonpete Excel Worksheet Functions 0 November 30th 07 03:51 PM
If than Else Trouble Goofy Excel Worksheet Functions 2 February 19th 06 10:48 AM
Im in trouble!!! Please Help!! JS JimmyS Excel Discussion (Misc queries) 1 June 19th 05 10:21 PM


All times are GMT +1. The time now is 10:22 PM.

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

About Us

"It's about Microsoft Excel"