VBA Code and Protection Sheet
I am a bit confused now with all the answers.
I protect the sheet thru Tools/Protection/Protect Sheet
so other users wont erase formulas by mistake.
Can the macro/VBA I run do the Unprotect Sheet function automatically
for me and re-protect it once the it is done running?
Amir
Jim Thomlinson wrote:
There are two possible solutions to your problem. If the sheet is protected
via code then you can add a paramter which will allow code to make any
changes it wants while still restricting the user. Something like this...
Sheets("Sheet1").Protect UserInterfaceOnly:=True, Password:="Tada"
If that is not how the sheet is protected then you need to unprotect the
sheet each time Code is going to make any changes to the sheet similar to
what has already been posted...
--
HTH...
Jim Thomlinson
"amirstal" wrote:
Does Excel have a problem running a VBA code when the worksheet is
protected? If yes, is there a way to overcome it?
Thanks.
|