trust access to Visual Basic Project checked

B

Boss

Can i check "trust access to Visual Basic Project" under tools, macro,
security, using macro..
please help...

Thanks!
Boss
 
B

Bob Phillips

No, it would make a slight mockery of any security pretence don't you think.
But you can check it and tell the user to do it.


Function VBAIsTrusted() As Boolean
Dim mpVBC As Object
Dim mpAlerts As Boolean
mpAlerts = Application.DisplayAlerts
Application.DisplayAlerts = False
On Error Resume Next
Set mpVBC = ThisWorkbook.VBProject.VBComponents.Item(1)
On Error GoTo 0
Application.DisplayAlerts = mpAlerts
VBAIsTrusted = Not mpVBC Is Nothing
End Function
 
B

Boss

Thanks for the reply Bob,

But something can be done using the commandbar ID.

I found it in a different community.

Thanks!
 
B

Bob Phillips

Care to show us, I would be intrigued to see how the security is
circumvented.
 
Top