View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Macro problem when sheet protected

Sub MyMacro()
On Error goto ErrHandler
worksheets("Sheet1").Unprotect Password:="ABC"
' current code

ErrHandler:
Worksheets("sheet1").Protect Password:="ABC"
End Sub

--
Regards,
Tom Ogilvy


"WLMPilot" wrote:

I have run into a problem with macros not executing when a sheet is protected
in Excel. I use Office XP.

Any ideas on this?

Thanks,
Les