In the internet I found an excel version and changed it for MS Project. The Set Module = ActiveProject.VBProject.VBComponents(name).CodeModule does work but the Set Module = GlobalMPT.VBProject.VBComponents(name).CodeModule does not give an error but it does not work either....
Any idea??
Any idea??
VBA Code:
Sub tester()
Debug.Print Is_Module_Loaded("Module1")
End Sub
Public Function Is_Module_Loaded(name As String) As Boolean
Dim Module As Object
On Error Resume Next
'Set Module = ActiveProject.VBProject.VBComponents(name).CodeModule
Set Module = GlobalMPT.VBProject.VBComponents(name).CodeModule
On Error GoTo 0
Is_Module_Loaded = Not Module Is Nothing
If Not Is_Module_Loaded Then
MsgBox ("MODULE: " & name & " is not installed please add")
Else
MsgBox ("MODULE: " & name & " is already installed")
End If
End Function