Quote:
Originally Posted by Purfleet
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
Worksheets("Form").Protect
End Sub
|
If you save before closing,
then protect the sheet, I suspect the workbook will ask again if it should be saved to which you have to answer
Yes in order for the sheet to be protected in the saved file.
Personally, as your codicil suggests being wary of .Save, I'd miss it out altogether in that event handler and only include the .Protect line. That way, whether the file is saved or not (with/without erroneous changes made by the user) is left for the user to decide, which is the usual behaviour on closing a workbook.