Backing Up Workbooks

  • Thread starter Thread starter Ed Davis
  • Start date Start date
E

Ed Davis

Currently I have a macro button to backup my workbooks.
I also have a save button.
I would like to use only the save button but on a specific day of the week
say Tuesday I would the macro also to do a backup.
Can someone tell me the code to do this.
I use the following to save the file.

ActiveWorkbook.Save
ActiveWorkbook.Close

I use the following to backup the workbook.


ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Splash").Select
ActiveWorkbook.SaveAs Filename:="C:\Posto Pote\Backup\Posto Pote.xls", _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ChDir "C:\Posto Pote"
ActiveWorkbook.SaveAs Filename:="C:\Posto Pote\Posto Pote.xls",
FileFormat _
:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False




Thank you for any and all help.
Ed Davis
 
Sorry I forgot to mention I would like the macro to not ask if I want to
replace the file on backups. It needs to do it without asking.
 
application.displayalerts = false
ActiveWorkbook.SaveAs Filename:="C:\Posto Pote\Backup\Posto Pote.xls", _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
application.displayalerts = false
ActiveWorkbook.SaveAs Filename:="C:\Posto Pote\Posto Pote.xls", _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
application.displayalerts = true

if Weekday(Date) = vbTuesday then
ActiveWorkbook.SaveCopyAs Filename:="C:\Posto Pote\Backup\Posto Pote.xls"
end if
 
Back
Top