We help IT Professionals succeed at work.

How can I get an Excel Macro to save the file to CSV format?

Member_2_5306354
Member_2_5306354 asked
on
What Excel Macro will allow me to save the file to a CSV file?
The file can be called ToImport.csv
Comment
Watch Question

you mean instruction ?

ActiveWorkbook.SaveAs Filename:=ActiveWorkbook.Path & "\FileCSV.csv", FileFormat:=xlCSV

where FileCSV.CSV is the name of the file you want replace it by its proper name.

gowflow

Author

Commented:
Compile Error:
Invalid Outside Procedure.
What do you mean where did you put this ?
gowflow
it should be something like this

Sub SaveasCSV
ActiveWorkbook.SaveAs Filename:=ActiveWorkbook.Path & "\FileCSV.csv", FileFormat:=xlCSV
End Sub

Open in new window


gowflow