Check VBAproject is protected or not

H

helmekki

Hi there

Is there a vba code to check if the VBAproject is protected or not ,
and if not some action will be done ?
 
L

Leith Ross

Hello Hesham,

If you have another Workbook open along with your project then the
answer is yes. You must add a reference to the VBA Extensibility
Library for this code to work.

Answer = VBAProject("Project Name").Protected

If Answer is yes, the project is protected.

Sincerely,
Leith Ross
 
D

Dave Peterson

something like:

If ActiveWorkbook.VBProject.Protection Then
MsgBox "Protected project" & vbLf & "Cannot complete"
Exit Sub
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top