Automatic backup in excel with copy to hard drive and to cd-rw

T

Tammies PITA

How do I get Excel to either automatically backup to hard drive and cd-rw, or
even when I hit save icon, go ahead and save to hard drive and cd-rw. I
already have auto save setup but backup file goes to same hard drive folder
as origianl copy. Kind of defeats the purpose of a system crash and wanting
a copy on removable media. Thanks for your help!
 
O

Otto Moehrbach

Here is an Excel macro that copies the saved file to another folder in the
hardrive. You can easily modify this macro to have it also copy the saved
file to the CDRW. HTH Otto
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
'Change the following path to your own
Const szBackupPath As String = "C:\Documents and Settings\Otto
Moehrbach\My Documents\ExcelData\Backup"
'If they're not using the Save As command...
If Not SaveAsUI Then
'Cancel Excel 's Save
Cancel = True
'Save this workbook before backing it up
Application.EnableEvents = False
ThisWorkbook.Save
Application.EnableEvents = True
'Save a backup copy to the szBackupPath location
ThisWorkbook.SaveCopyAs szBackupPath & ThisWorkbook.Name
End If
End Sub
 

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

Top