FindVBAObject

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

Parameters

VBAObjectname, Optional ThisWB

Views 110 Downloads 54

Perm link