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

What Excel Macro will allow me to save the file to a CSV file?
The file can be called ToImport.csv
100questionsAsked:
Who is Participating?
 
gowflowCommented:
it should be something like this

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

Open in new window


gowflow
0
 
gowflowCommented:
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
0
 
100questionsAuthor Commented:
Compile Error:
Invalid Outside Procedure.
0
 
gowflowCommented:
What do you mean where did you put this ?
gowflow
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.