A
Andyjim
I have to unprotect sheets during a macro, move some data, then reprotect.
I'm using an 8 character password. Before running the macro,
Tools>Protection>Unprotect sheet prompts for the password. But after running
the macro (and remember the macro does reprotect with the 8 character
password), it is protected, but Tools>Protection>Unprotect sheet unprotects
it without requiring a password.
I need the formulas and macro code to be inaccessible to users. Is there
some syntax I need to add to make this happen? It seems like the
protect/unprotect in VBA is somehow separate from the protect/unprotect in
the workbook itself. Here's what I'm using:
ActiveSheet.Unprotect Password:="xxxxxxxx"
'data manipulations
ActiveSheet.Protect Password:="xxxxxxxx", DrawingObjects:=True,
Contents:=True, Scenarios:=True
I'm using an 8 character password. Before running the macro,
Tools>Protection>Unprotect sheet prompts for the password. But after running
the macro (and remember the macro does reprotect with the 8 character
password), it is protected, but Tools>Protection>Unprotect sheet unprotects
it without requiring a password.
I need the formulas and macro code to be inaccessible to users. Is there
some syntax I need to add to make this happen? It seems like the
protect/unprotect in VBA is somehow separate from the protect/unprotect in
the workbook itself. Here's what I'm using:
ActiveSheet.Unprotect Password:="xxxxxxxx"
'data manipulations
ActiveSheet.Protect Password:="xxxxxxxx", DrawingObjects:=True,
Contents:=True, Scenarios:=True