A little help with SaveAs Method please

  • Thread starter Thread starter Stitch45
  • Start date Start date
S

Stitch45

I have a VBA macro that opens a selected CSV file and executes. What is the
code required to make the macro save the CSV file as an Excel Workbook, with
the same name and in the same location?

Appreciate the help

thanks
 
Stitch,

Using the macro recorder and then modifying, I got this. It assumes the
book your saving is the activeworkbook:

Sub Test()
ActiveWorkbook.SaveAs Filename:= _
Replace(LCase(ActiveWorkbook.Name), "csv", "xls"), FileFormat:=xlNormal
_
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub

hth,

Doug
 
Back
Top