I'll offer a possible workaround macro that you could put into your workbook
to make recovery easier if someone does overwrite your file. Put this code
into the WORKBOOK's code segment. To get there quickly, right-click on the
little Excel icon immediately to the left of "File" in the menu toolbar and
choose [View Code] from the popup list - copy this code and paste it into
that and save the workbook.
What it does: it intercepts File | Save and even File | Save As (meaning
you won't be able to Save As with another name - you'd have to go into the
folder and rename it there) and even the click on the floppy icon for save,
and [Ctrl]+ actions. It looks at the current file name, and is written
presuming it ends with the standard ".xls" file extension. It then sticks
..bak between the original main part of the filename and the .xls and puts
..xls back onto it and saves it that way, then again saves it as the original
filename and exits. It puts the .bak.xls copy into the same folder that the
original file is in.
So if you started with this in a file named myWorkbook.xls and you end up
with 2 files
myWorkbook.bak.xls
and the latest copy of
myWorkbook.xls
saved to the same folder. The Cancel option is set to True to just abort
out of your requested Save/Save As operation, since it has already been done
for you by this routine.
At least this way, you can always fall back to the .bak.xls version, using
Windows explorer to delete the overwritten .xls version and copying the
..bak.xls version to the folder and renaming it properly.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
'this will first save the workbook with a modified name as
'myWorkbook.bak.xls and then go ahead and
'save it with the original filename (myWorkbook.xls)
'when a save is performed
Dim OriginalName As String
Dim BackupName As String
OriginalName = ThisWorkbook.FullName
BackupName = Left(OriginalName, Len(OriginalName) - 4) & ".bak" & _
Right(OriginalName, 4)
Application.EnableEvents = False
Application.DisplayAlerts = False ' no "file exists" please
ActiveWorkbook.SaveAs Filename:=BackupName, FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.SaveAs Filename:=OriginalName, FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True ' turn them back on
Application.EnableEvents = True ' and these also
Cancel = True ' we did it once, why do it again
End Sub