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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find properties of an object

Status
Not open for further replies.

ammiller

Programmer
Nov 21, 2002
8
IE
Hi,

I am trying to determine if a worksheet is protected.
The worksheet in question is in a multi worksheet workbook.
It is also the active worksheet.

I tried looking at the "activesheet" properties - but cannot find a definitive list. I stumbled across one called "protectionmode" but that seems to return "false" whether or not the worksheet is protected.

Is there a way in the VBA help I can find the definitive list of properties of an object?

Thanks

Aidan
 
Activesheet is an object of type "worksheet" (or "sheet"). If you look up "worksheet object" in VBA help, you'll have a help item listing all the properties. That works for any Excel object type, not just worksheet.
Rob
[flowerface]
 
Aidan,

check out the object browser as well ... press [F2} & it'll appear. You can enter a keyword in the search box, & all objects with your keyword as part of their name will appear. makes it easier to look, because once you've got the proper VBA name it's easier rto search VBA help

As for checking whether a worksheet is protected - use something like this:
Code:
Dim l_wksSheet As Worksheet
Set l_wksSheet = ThisWorkbook.Sheets(1)
MsgBox "Protection = set to: " & l_wksSheet.ProtectContents

Yuo've got 3 of these readonly boolean worksheet properties:
Code:
ProtectContents
ProtectDrawingObjects
ProtectScenarios
For workbook protection use
Code:
ProtectWindow
ProtectStructure

Hope this helps

Cheers
Nikki
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top