Trouble with csv export...

G

Guest

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 '
 
C

Chip Pearson

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)
 
D

Dave Peterson

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.
 
D

Dave Peterson

Ignore that first portion of my reply. That showed how to import the file--not
export.

But you can change the list separator.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top