Try this:
Option Explicit
Sub SaveAsSJIS(sFullName As String)
Dim oWbk As Workbook
On Error GoTo Err_SaveAsSJIS
Set oWbk = Workbooks.Add
oWbk.WebOptions.Encoding = msoEncodingJapaneseShiftJIS
oWbk.SaveAs Filename:=sFullName, FileFormat:=xlCSV, TextCodepage:=msoEncodingJapaneseShiftJIS
oWbk.Close SaveChanges:=True
Exit_SaveAsSJIS:
On Error Resume Next
Set oWbk = Nothing
Exit Sub
Err_SaveAsSJIS:
MsgBox Err.Description, vbExclamation, Err.Number
Resume Exit_SaveAsSJIS
End Sub
Usage:
Sub TestTextCodePage()
SaveAsSJIS "C:\testCP.csv"
End Sub
I think, the
TextCodepage
variable is equal to
MsoEncodingEnumeration. See it on:
http://office.microsoft.com/en-ca/excel-help/HV080559483.aspx[
^]