Save As CSV Western European Windows Encoding

dgr

Board Regular
Joined
Apr 24, 2005
Messages
176
Hi,
I'm using Excel 2013. This issue is related to both Excel & Word.

I want to save a worksheet as a csv with Western European Windows Encoding (alternatively known as Window Default Encoding). This is because I plan to open this csv file in Word 2013 with Western European Windows Encoding. I don't want to be prompted by the File Conversion dialog box in Word too. My code is below. How do I edit it accordingly?
Code:
Sub Macro1()

    Cells.Select
    Range("J1").Activate
    Selection.Copy
    Workbooks.Add
    ActiveSheet.Paste
    Application.CutCopyMode = False
    ChDir "C:\path\to\Desktop"
    ActiveWorkbook.SaveAs Filename:= _
        "C:\path\to\Desktop\the_csv_file.csv", FileFormat:=xlCSV, _
        CreateBackup:=False
    ActiveWorkbook.Save
    ActiveWindow.Close
End Sub
Alternatively, I plan to open this csv file using a Word macro. Is there any code I can enter into the Word macro to force Word to open the csv file with with Western European Windows Encoding? My Word macro is below. Thanks for your help.
Code:
Sub open_csv()

    ChangeFileOpenDirectory "C:\path\to\file\"
    Documents.Open FileName:="the_csv_file.csv", ConfirmConversions:=False, _
        ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
        PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
        WritePasswordTemplate:="", Format:=wdOpenFormatAuto
End Sub
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Watch MrExcel Video

Forum statistics

Threads
1,129,816
Messages
5,638,496
Members
417,029
Latest member
lingx86

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
Top