Backing Up Workbooks

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
 
E

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.
 
D

Dave Peterson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top