Macro - How to save as a text file, and retain international formatting

Rick_M

New Member
Joined
May 11, 2011
Messages
1
I'm trying to write an Excel macro to save a worksheet as a tab delimited text file, and have it save using international formatting settings (i.e., use a comma as decimal place holder and space as thousands seperator). When I do this from the menus, it works. I've even recorded the macro when I do this from the menus. Yet when I run the resulting macro, the text file uses the system defaults (i.e., uses a period as decimal place holder and comma as thousands seperator).

Here is code from the macro I've created.

With Application
.DecimalSeparator = ","
.ThousandsSeparator = " "
.UseSystemSeparators = False
End With

ActiveWorkbook.SaveAs Filename:= _
"C:\Test\11May11.txt", FileFormat:=-4158, CreateBackup:=False

I'm running on Excel 2002.

If anyone has any ideas how to force Excel to retain the international formatting when saving as a text file, I'd greatly appreciate any advice.

Thanks,
Rick_M
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,224,597
Messages
6,179,813
Members
452,945
Latest member
Bib195

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top