View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Strange worksheet protection behavior

Hi Patrick,

Replace the suggested code with:

'=============
Private Sub Workbook_Open()
Dim SH As Worksheet
Const PWORD As String = "ABC" '<<=== CHANGE

For Each SH In Me.Worksheets
With SH
.Unprotect password:=PWORD
.EnableSelection = xlUnlockedCells
.Protect password:=PWORD, _
DrawingObjects:=True, _
Contents:=True, _
Scenarios:=True
End With
Next SH

End Sub
'<<=============

---
Regards,
Norman