Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Test for VBAProject Locked from Viewing

Is it possible to test from within my Excel program
as to whether the overall VBAProject is Locked from Viewing?
(I would like to branch one way within the program for knowledgable,
trustworthy users who have the unlocked version, but another way
for regular users for whom the code is locked from viewing.)

-- Dennis Eisen

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Test for VBAProject Locked from Viewing

Dennis,

Try something like the following:

If ThisWorkbook.VBProject.Protection = 0 Then
Debug.Print "Not locked"
Else
Debug.Print "Locked"
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"DennisE" wrote in message
...
Is it possible to test from within my Excel program
as to whether the overall VBAProject is Locked from Viewing?
(I would like to branch one way within the program for

knowledgable,
trustworthy users who have the unlocked version, but another

way
for regular users for whom the code is locked from viewing.)

-- Dennis Eisen



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Test for VBAProject Locked from Viewing

Chip,
Thanks so much for your help; my
final version took the form

If ThisWorkbook.VBProject.Protection _
= vbext_pp_locked Then
[do this code for simpletons]
Else
[do this code for the cognesenti]
End If

(This requires early binding with vbe6ext.olb, but my program required it
anyway.)

-- Dennis Eisen
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
Viewing of protected locked or unlocked cells jmisenar Excel Worksheet Functions 2 April 22nd 09 04:58 AM
Viewing Formulas in Locked Cells stacy05 Excel Discussion (Misc queries) 1 December 5th 07 04:10 PM
Is there any way of viewing the formula of a locked cell? td Excel Worksheet Functions 2 March 20th 07 08:13 PM
Viewing LOCKED cells AC_VID Excel Discussion (Misc queries) 1 April 9th 05 11:19 PM
Excel 2003 when closing Excel after having opened a project locked for viewing.. password prompt??? braindead Excel Discussion (Misc queries) 0 March 25th 05 01:58 PM


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