setting the protect option

K

Keith

I have a worksheet that has protection switched on. When a certain routine is
run I need to turn the protection off do the routine then turn it back on
again.

When I initially protect the worksheet I need to set the Edit Objects so
that my routines will run properly.

Unfortunately I can't seem to set that back on again when I turn the protect
back on inside my code.

Is there a way to turn the protect back on and use edit object from within
VBA?
 
C

caroline

This is the code I generally use

'Unprotect
ActiveSheet.Unprotect password:="XXX"

'Protect
With ActiveSheet
.EnableSelection = xlNoRestrictions
.Protect Contents:=True, password:="XXX", DrawingObjects:=True,
UserInterfaceOnly:=False
End With
 
K

Keith

Yes but I cant seem to find a command for setting the EditObject part of
protect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top