Hi,
I have never worked with add-in before and I am having problems. I am using a master add-in to reference code for over 100 files. I know how to install the add-in and it's reference by VBA. But when I update the code in master add-in (which btw gives a pop-up "xxx.xla is already open" when I open it), all other files reference the old add-in and are not updated by master add-in. Below is my WorkbookOpen event code: What am I doing wrong?
On Error Resume Next
'add the add-in
If AddIns("Cclmodules_Tel").Installed = False Then
AddIns.Add("\\cadd-ntsrv00\cadd-drv\Shared_Files\Cable Material Catalogue\CCLModules_TEL.xla", True).Installed = True
End If
'add the add-in reference
Dim i As Integer, refExists As Boolean
refExists = False
For i = 1 To ThisWorkbook.VBProject.References.Count
If ThisWorkbook.VBProject.References(i).Name = "TELModules" Then
refExists = True
Exit For
End If
Next i
If Not refExists Then ActiveWorkbook.VBProject.References.AddFromFile Environ("AppData") & "\Microsoft\AddIns\CCLModules_TEL.xla"
' Application.Run "CCLModules_Tel.xla!WorkbookOpenEvent"
' if an error other than 32813 appeared means there is a problem, add that library manually
If Err <> 0 And Err <> 32813 Then
MsgBox "One or more VBA Object libraries not loaded properly." & vbCrLf _
& "Error " & Err.Number & ": " & Err.Description
End If
Bookmarks