Protection
I think I'd let the user close without protecting the sheets.
But apply the password the next time the workbook was opened:
Option Explicit
Sub auto_open()
Dim myPwd As String
Dim wks As Worksheet
myPwd = "whateveryouwant"
For Each wks In ThisWorkbook.Worksheets
If wks.ProtectContents _
Or wks.ProtectDrawingObjects _
Or wks.ProtectScenarios Then
'already protected
Else
wks.Protect Password:=myPwd
End If
Next wks
End Sub
The bad news is that if the user disables macros (or just stops auto_open), you
could be in trouble.
Karen wrote:
I have a workbook that consists of approx. 60
worksheets. Each worksheet is individually password
protected with the same password. At times, someone
forgets to protect one worksheet before closing the
file. Is there a way to prompt the user with a message
(I'll assume it requires VBA code) on closing if he or
she forgets to password protect one or more of the
worksheets?
Thank you
--
Dave Peterson
|