Protection controlled by macro

  • Thread starter Thread starter Crownman
  • Start date Start date
C

Crownman

I have a worksheet that is password protected. I want to create a
macro that will unprotect the worksheet, perform several operations,
and then reprotect the worksheet using the same password.

I have tried including the password within the macro to unprotect and
reprotect the worksheet, but I still get prompted for the password when
the macro runs.

Does anyone have any suggestions on how this can be accomplished?

Thanks for any help.

Crownman
 
ActiveSheet.Unprotect Password:="justme"
'do your stuff
ActiveSheet.Protect Password:="justme"


Gord Dibben MS Excel MVP
 
Back
Top