How many copies of a file can be updated by the "File/Save" comma.

D

Dale

Same File, saved in two different locations, for two different users, be
updated at the same time when selecting the File - Save command?
 
O

Otto Moehrbach

This macro saves the file to one other folder when the file is saved. You
can modify it to repeat the copy to another folder. 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