Save from exe file to csv file

  • Thread starter Thread starter Steved
  • Start date Start date
S

Steved

Hello from Steved

Please how do I save a file name "missedtrips21-nov.xls" and save it as
"missedtrips21-nov.csv"

Ok the next day may be "missedtrips22-nov.xls" and the day after may be
"missedtrips23-nov.xls" they need to be saved as "missedtrips22-nov.csv" and
"missedtrips23-nov.csv"

In closing it is a different file daily. I need the code to read the current
file name and then save from xls to csv.

Thankyou.
 
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 1/16/2008 by Joel Warburg
'

'
folder = ActiveWorkbook.Path
bookname = ActiveWorkbook.Name
bookname = Left(bookname, Len(bookname) - 3)
bookname = folder & "\" & bookname & "cvs"

ActiveWorkbook.SaveAs Filename:=bookname, _
FileFormat:=xlCSV, CreateBackup:=False
End Sub
 
Thankyou very much.

Joel said:
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 1/16/2008 by Joel Warburg
'

'
folder = ActiveWorkbook.Path
bookname = ActiveWorkbook.Name
bookname = Left(bookname, Len(bookname) - 3)
bookname = folder & "\" & bookname & "cvs"

ActiveWorkbook.SaveAs Filename:=bookname, _
FileFormat:=xlCSV, CreateBackup:=False
End Sub
 
Back
Top