Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Protected Objects

Status
Not open for further replies.

rgandy

Technical User
Nov 17, 2005
38
US
in password protecting a sheet, what property must i access to unprotect an object so that it may be changed even if the remainder of the sheet is password protected?
 
Protect your worksheet via code using the something like the following:
Code:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, [b]UserInterfaceOnly:=True[/b]

This will allow your procedures to manipulate worksheet objects with protection in place.


Regards,
Mike
 
I should have added that the line of code to protect the worksheet should be located in the Workbook_Open event procedure so that it runs every time the workbook is opened. This is necessary because the protection is transient, unlike when invoked through the UI. Your other options are to not protect for Drawing Objects or to have your code turn off sheet protection/manipulate the objects/restore sheet protection.


Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top