Having trouble getting 'Local' parameter in SaveAs method to work

P

peter.huang

Hi,

I am having trouble getting the 'Local' parameter in SaveAs to work.
I'm sure I'm missing something really simple. Here is a little VB
program that I wrote:
--------------
Private Sub Command1_Click()
Dim excel As Application
Dim docs As Workbooks
Dim doc As Workbook
Dim wksheets As Sheets
Dim wksheet As Worksheet

Set excel = New Application
Set doc = excel.Workbooks.Open("c:\book1.xls", Local:=True)

Set wksheets = doc.Sheets

Set wksheet = wksheets.Item(1)

wksheet.SaveAs "c:\test3.txt", FileFormat:=xlCSV, Local:=True

End Sub
-----------
I set my regional settings to German/Austrian (currency->€
123.456.789,00). My excel doc is set to use system settings in the
international tab of the tools option dialog. My doc contains five
currency cells which appear as € 123.456.789,00.

Anyway, the above program always generates a .csv in US format. (I have
tried as combinations of specifying Local:=True for Open and SaveAs as
I was not sure if I had to specificy it for both or just one.

I have tried this on two machines. One with excel.10 installed and one
with excel.11. Neither work.

I'm sure it's something simple I'm overlooking.

Any help that you could give me on this matter would be appreciated.

Regards,

Peter Huang
 
T

Tom Ogilvy

Check out Stephen Bullen's chapter on International Issues at his site:

http://www.oaltd.co.uk/ExcelProgRef/ch22/

see if he doesn't cover this issue.

--
Regards,
Tom Ogilvy


Hi,

I am having trouble getting the 'Local' parameter in SaveAs to work.
I'm sure I'm missing something really simple. Here is a little VB
program that I wrote:
--------------
Private Sub Command1_Click()
Dim excel As Application
Dim docs As Workbooks
Dim doc As Workbook
Dim wksheets As Sheets
Dim wksheet As Worksheet

Set excel = New Application
Set doc = excel.Workbooks.Open("c:\book1.xls", Local:=True)

Set wksheets = doc.Sheets

Set wksheet = wksheets.Item(1)

wksheet.SaveAs "c:\test3.txt", FileFormat:=xlCSV, Local:=True

End Sub
-----------
I set my regional settings to German/Austrian (currency->?
123.456.789,00). My excel doc is set to use system settings in the
international tab of the tools option dialog. My doc contains five
currency cells which appear as ? 123.456.789,00.

Anyway, the above program always generates a .csv in US format. (I have
tried as combinations of specifying Local:=True for Open and SaveAs as
I was not sure if I had to specificy it for both or just one.

I have tried this on two machines. One with excel.10 installed and one
with excel.11. Neither work.

I'm sure it's something simple I'm overlooking.

Any help that you could give me on this matter would be appreciated.

Regards,

Peter Huang
 

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