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