Consulting

Results 1 to 3 of 3

Thread: Ribbon Control not displayed at file open

  1. #1

    Ribbon Control not displayed at file open

    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:
    2018-05-21 17_00_53-Add-ins.png

    2018-05-21 17_01_50-Microsoft Excel.png

    Thank you for any advice !

  2. #2
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    You could try toggling the Installed property:

    xlAddin.Installed = False
    xlAddin.Installed = True
    Be as you wish to seem

  3. #3
    Now that was obvious.
    Thanks Aflatoon!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •