Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Programmatically determining if worksheet is protected

How would I check to see if the activesheet is protected? I know how to
protect and unprotect programmatically, but only want to unprotect it if it's
already protected.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Programmatically determining if worksheet is protected

If Worksheets("Sheet1").ProtectContents = True Then
MsgBox "The contents of Sheet1 are protected."
End If
--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Barb Reinhardt" wrote in message
...
How would I check to see if the activesheet is protected? I know how to
protect and unprotect programmatically, but only want to unprotect it if

it's
already protected.

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Programmatically determining if worksheet is protected

It is not really worth checking. Just run the unprotect. You can however
check to see if it is protected something like this...

dim wks as worksheet

for each wks in worksheets
if wks.protectcontents = true then wks.unprotect
next wks
--
HTH...

Jim Thomlinson


"Barb Reinhardt" wrote:

How would I check to see if the activesheet is protected? I know how to
protect and unprotect programmatically, but only want to unprotect it if it's
already protected.

Thanks

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
Programmatically determining corrupt excel files Greg Luce[_2_] Excel Discussion (Misc queries) 0 December 14th 07 06:19 PM
Programmatically determining CODE NAME for sheet based upon Sheet Barb Reinhardt Excel Programming 14 August 15th 06 06:49 PM
Determining last active cell in a protected worksheet Paul Excel Programming 2 August 10th 06 05:40 PM
Programmatically delete macro using a protected project John Cole, Jr. Excel Programming 1 November 14th 04 04:22 PM
How to programmatically check if a workbook is protected t? uno@korsmaa Excel Programming 2 September 15th 04 09:23 PM


All times are GMT +1. The time now is 09:02 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"