Excel VBA doesn't recognize manually opened .xlam add-in
I have an excel add-in that can't be found in Application.AddIns. I'm manually opening the add-in by going to File -> Open -> browse to addin.xlam. Do add-ins need to be programmatically added in order to show up in Application.AddIns?
I do not see my addin in either of these print functions. In the first one, it just prints the name of my current workbook and that is all. The second one successfully prints out my other 10 add-ins that have been programmatically added, but not the one that was manually added.
Sub MsgWorkbooks() Dim s As String For Each wb In Workbooks s = s + app.Name Next wb MsgBox s End Sub Sub MsgAddIns() Dim s As String For Each app In Application.AddIns s = s + app.Name Next app MsgBox s End Sub
Maybe you need to install it:
Sub InstallAddIn() Dim AI As Excel.AddIn Set AI = Application.AddIns.Add(Filename:="d:\addin.xlam") 'change the addin fullname AI.Installed = True End Sub
more information here
As Doug Glancy comment we can check whether the addin is available like any normal workbook. so we can use this function:
Function IsAddinLoaded(adName As String) As Boolean Dim addinWB As Workbook On Error Resume Next Set addinWB = Workbooks(adName) If Err = 0 Then IsAddinLoaded = True On Error GoTo 0 End Function
Sub Test() if IsAddinLoaded("addin.xlam") = true Then ' change the name of addin msgbox "Addin is loaded" Else msgbox "Addin not loaded" End if End Sub