Finds specific VBA object in VBE project
User need to setup to trust VBA Access, default is not trust
Function FindVBAObject(VBAObjectname, Optional ThisWB = "This") As Boolean
' finds if VBA Object is found or not
' User need to setup to trust VBA Access, default is not trust
If ThisWB = "This" Then ThisWB = ThisWorkbook.Name
FindVBAObject = False
For Each VBO In Workbooks(ThisWB).VBProject.VBComponents
If UCase(VBAObjectname) = UCase(VBO.Name) Then
FindVBAObject = True
Exit Function
End If
Next
End Function
' finds if VBA Object is found or not
' User need to setup to trust VBA Access, default is not trust
If ThisWB = "This" Then ThisWB = ThisWorkbook.Name
FindVBAObject = False
For Each VBO In Workbooks(ThisWB).VBProject.VBComponents
If UCase(VBAObjectname) = UCase(VBO.Name) Then
FindVBAObject = True
Exit Function
End If
Next
End Function
VBAObjectname, Optional ThisWB
Views 3,171
Downloads 1,274
CodeID
DB ID