Hi there,
The following code will check whether a given procedure, function or sub exists in one of your VB projects modules:
Required reference:
-Microsoft Visual Basic for Applications Extensibility
There are most likely other ways of doing this, but for me this sufficed.
The following code will check whether a given procedure, function or sub exists in one of your VB projects modules:
Required reference:
-Microsoft Visual Basic for Applications Extensibility
Code:
Function ProcedureExists(ProcedureName As String) As Boolean
Dim m As Module, mo As Modules, i As Integer, p As Integer
ProcedureExists = True
On Error Resume Next
Set mo = Application.Modules
For i = 0 To mo.Count - 1
p = mo(i).ProcBodyLine(ProcedureName, vbext_pk_Proc)
If Err.Number <> 35 Then
Exit Function
End If
Next
ProcedureExists = False
End Function