A
appeng
I am using MS Excel 97 and trying to save a backup copy of files, with date
and time saved, to a specific directory while maintaining the original file
name for the active workbook. For example
Original workbook 1 name = c:\data\schedule.xls
Original workbook 2 name = c:\data\data.xls
When saved, save a copy in c:\temp
With file name schedule NOV0504 623AM.xls
Or data NOV404 703PM.xls
The original file would remain
c:\data\schedule.xls and c:\data\data.xls
I have tried the following but cannot get it to work
Sub Save_Workbook()
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs FileName:= _
“c:\temp\†& _
Left(ThisWorkbook.Name, InStr(1, LCase(ThisWorkbook.Name), ".xls") - 1) _
& Format(Date, "mmddyy") & Format(Date, "hhmmAMPM") & ".xls"
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True
End Sub
I am sure I am missing something simple. Any suggestions?
and time saved, to a specific directory while maintaining the original file
name for the active workbook. For example
Original workbook 1 name = c:\data\schedule.xls
Original workbook 2 name = c:\data\data.xls
When saved, save a copy in c:\temp
With file name schedule NOV0504 623AM.xls
Or data NOV404 703PM.xls
The original file would remain
c:\data\schedule.xls and c:\data\data.xls
I have tried the following but cannot get it to work
Sub Save_Workbook()
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs FileName:= _
“c:\temp\†& _
Left(ThisWorkbook.Name, InStr(1, LCase(ThisWorkbook.Name), ".xls") - 1) _
& Format(Date, "mmddyy") & Format(Date, "hhmmAMPM") & ".xls"
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True
End Sub
I am sure I am missing something simple. Any suggestions?