Option Explicit Sub TestModExists() Debug.Print ModExists("ArcID") Debug.Print ModExists("xyz") End Sub Function ModExists(name As String) As Boolean ModExists = False Dim pVBE As VBIDE.VBE Set pVBE = Application.VBE Dim l As Long For l = 1 To pVBE.VBProjects.Count Dim k As Long For k = 1 To pVBE.VBProjects(l).VBComponents.Count If pVBE.VBProjects(l).VBComponents(k).Type = vbext_ct_StdModule Then Dim s As String s = UCase(pVBE.VBProjects.Item(l).VBComponents(k).name) If s = UCase(name) Then ModExists = True Exit Function End If End If Next k Next l End Function
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.