Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How to programmatically check if a workbook is protected t?

Hello

How to programmatically check if a workbook is protected or not?

Rgs
Uno Kõrsmaa


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to programmatically check if a workbook is protected t?

For a workbook

With Workbook
if .ProtectWindows or
.ProtectStructure then

End if
End With


For a Worksheet

With ActiveSheet
if .ProtectContents = True or _
.ProtectDrawingObjects = True or _
.ProtectScenarios = True or _
.ProtectMode = True then

' sheet is protected
End if
End With



If you want to know if a workbook is password protected, I believe you have
to attempt to open it and see if the attempt fails (suppressing the prompt
and handling the error)

--
Regards,
Tom Ogilvy


"uno@korsmaa" wrote in message
...
Hello

How to programmatically check if a workbook is protected or not?

Rgs
Uno Kõrsmaa




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to programmatically check if a workbook is protected t?



Thank you very much.

Kind regards
Uno Kõrsmaa

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM
Spell Check in Protected Worksheet & Shared Workbook DaveyC4S Excel Discussion (Misc queries) 6 October 28th 05 12:50 PM
Spell Check in Protected Worksheet & Shared Workbook continued DaveyC4S Excel Discussion (Misc queries) 1 October 25th 05 06:15 PM
How to check programmatically whether Excel is installed on computer? Jack Excel Programming 7 February 15th 04 02:30 AM
Close Workbook Programmatically Lucy[_2_] Excel Programming 3 December 30th 03 08:17 PM


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