Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Check if Worksheet TAB is protected or Not Ananth Excel Discussion (Misc queries) 3 March 30th 09 01:08 PM
Spell Check with protected sheets Karissa Excel Discussion (Misc queries) 3 January 26th 09 03:08 PM
Check Activesheet for chart sheet or work sheet NSK Charts and Charting in Excel 1 July 17th 07 09:00 PM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM
password protected a check box Glendon MacBurnie Excel Worksheet Functions 0 January 27th 05 07:52 PM


All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"