Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I verify if "Trust access to visual basic project" is chec
I have a macro that requires this option to be checked.
"Trust access to visual basic project" I know the only way to check the box is either manually or through Send Keys. Is there a way through some property to see if it is checked or unchecked? If there is, I can shut the macro down prior to it crashing with a dialog box telling the user what to do to enable all the features. This would really help! Thanks, MikeZz |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I verify if "Trust access to visual basic project" is chec
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 -- __________________________________ HTH Bob "MikeZz" wrote in message ... I have a macro that requires this option to be checked. "Trust access to visual basic project" I know the only way to check the box is either manually or through Send Keys. Is there a way through some property to see if it is checked or unchecked? If there is, I can shut the macro down prior to it crashing with a dialog box telling the user what to do to enable all the features. This would really help! Thanks, MikeZz |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I verify if "Trust access to visual basic project" is
Perfect! This will be a great help Bob,
"Bob Phillips" wrote: 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 -- __________________________________ HTH Bob "MikeZz" wrote in message ... I have a macro that requires this option to be checked. "Trust access to visual basic project" I know the only way to check the box is either manually or through Send Keys. Is there a way through some property to see if it is checked or unchecked? If there is, I can shut the macro down prior to it crashing with a dialog box telling the user what to do to enable all the features. This would really help! Thanks, MikeZz |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Trust Access to Visual Basic Project | Excel Programming | |||
Trust access to visual basic project is grayed out | Excel Programming | |||
Trust Access to Visual Basic Project | Excel Programming | |||
Trust access to visual basic project in XP systems | Excel Discussion (Misc queries) | |||
Registry key for "Trust access to Visual Basic project" | Excel Programming |