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