Question : Excel: Programmatically determine if Trust Access To VB Project has been set

Is it possible to determine, either in Excel VBA or through Interop with a VB.NET app, if the "Trust Access To VB Project" has been checked by the user in their Macro Security settings? If so, could someone provide me with an example code fragment?

Thanks

Answer : Excel: Programmatically determine if Trust Access To VB Project has been set

In VBA, you could do this:

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
Function TrustAccess() As Boolean
 
    Dim vbp As VBProject
 
    On Error Resume Next
    Set vbp = ActiveWorkbook.VBProject
 
    TrustAccess = (Err = 0)
 
End Function
Random Solutions  
 
programming4us programming4us