Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check if activesheet is protected
Hello Everyone!
I have a small problem that needs a simple solution. How do I check with VBA if my activesheet is password protected? What I want to have is a macro that protect if it's unprotected and vice verse. And this doesn't work, the red text must be something else : If ActiveSheet.Protect.Enabled = False Then ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="bossboss" Else ActiveSheet.Unprotect Password:="bossboss" End If Thanks in advance for your help! --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check if activesheet is protected
Freseh
change, If ActiveSheet.Protect.Enabled = False Then to If ActiveSheet.ProtectContents = false Then That should do the trick HTH --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to Check if Worksheet TAB is protected or Not | Excel Discussion (Misc queries) | |||
Spell Check with protected sheets | Excel Discussion (Misc queries) | |||
Check Activesheet for chart sheet or work sheet | Charts and Charting in Excel | |||
Enable check box in protected sheet + group check boxes | Excel Discussion (Misc queries) | |||
password protected a check box | Excel Worksheet Functions |