View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
stef stef is offline
external usenet poster
 
Posts: 20
Default bug in protect-unprotect macro

Jim,
You are totally correct.
That must be the problem; I do have charts....
Let me try your version and post back here. Thanks.

Jim Thomlinson wrote:
Do you have any chart sheets or such? If so then you will get the error you
discussed. Try this to see if it goes any better...

Sub ProtectAllSheets()
Dim wks As Worksheet

Application.ScreenUpdating = False
For Each wks In Worksheets
With wks
.Protect Password:="nosecret"
.EnableSelection = xlUnlockedCells
End With
Next wks
Application.ScreenUpdating = True
End Sub