Error 1004 in my Macro while saving a Excel workbook as a CSV for Japnese
I have written a simple Macro for saving all the Workbooks as separate CSV
files. This works fine on my local machine (English Lang) for paths like
*D:\MyFolder* .
But when I am trying the same Macro on another windows machine with
Japanese language enabled I am getting 1004 error for SaveAS method.
File paths like D:¥MyFolder¥
Below is the my code which is causing the error:
For Each WS In ThisWorkbook.Worksheets
newName = WS.Name & "-" & Format(Date, "yyyy-mm-dd") & "-" &
Format(Time, "hhmmss")
WS.Copy
ActiveWorkbook.SaveAs SaveToDirectory & newName, xlCSVMSDOS, Local:=True
ActiveWorkbook.Close Savechanges:=False
Next
No comments:
Post a Comment