Private Sub Workbook_BeforeClose(Cancel As Boolean)
' with password
ThisWorkbook.SaveAs Filename:="d:\test3.xls ", FileFormat:= _
xlNormal, Password:="abc", WriteResPassword:="abc1",
ReadOnlyRecommended:=False _
, CreateBackup:=False
'without password
ThisWorkbook.SaveAs Filename:="d:\test.xls "
The command you're looking for is SaveCopyAs
I would create a BeforeSave event,
there, save the file locally, then define the "backup" location, unprotect the
file, then save a copy at the backup location.
Let me know if you need specifics.
Paul
From: balder