Returns true if VBA is accessible through code, returns false if not
Function CanAccessVBA() As Boolean
CanAccessVBA = False
Err.Clear
On Error Resume Next
ThisName = ThisWorkbook.VBProject.VBComponents(1).Name
If Err.Number = 0 Then CanAccessVBA = True
On Error GoTo 0
Err.Clear
End Function
CanAccessVBA = False
Err.Clear
On Error Resume Next
ThisName = ThisWorkbook.VBProject.VBComponents(1).Name
If Err.Number = 0 Then CanAccessVBA = True
On Error GoTo 0
Err.Clear
End Function
Views 3,029
Downloads 1,241
CodeID
DB ID