trust access to Visual Basic Project checked

  • Thread starter Thread starter Boss
  • Start date Start date
B

Boss

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

Thanks!
Boss
 
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
 
Thanks for the reply Bob,

But something can be done using the commandbar ID.

I found it in a different community.

Thanks!
 
Back
Top