PDA

View Full Version : Ribbon Control not displayed at file open



pulsar777
05-21-2018, 08:04 AM
Hi, I have a corporate addin file named test.xlam (on purpose) that when installed,
a custom Ribbon tab will be displayed.

However when I have it as vba syntax in ThisWorkbook module, event Workbook_Open,
it not only displays the tab on ribbon, nor it appears in project explorer:



Private Sub Workbook_Open()

Dim addinPath As String
Dim xlAddin As Excel.AddIn

addinPath = Application.UserLibraryPath & "test.xlam"

With Application

With .AddIns
Set xlAddin = .Add(addinPath)
xlAddin.Installed = True
'Me.Activate
End With

End With
End Sub


To get it shown, I have to manually browse and physically add it again:
22292

22293

Thank you for any advice !

Aflatoon
05-22-2018, 04:16 AM
You could try toggling the Installed property:


xlAddin.Installed = False
xlAddin.Installed = True

pulsar777
05-22-2018, 09:40 AM
Now that was obvious.
Thanks Aflatoon!