Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Blue Springs, Missouri, USA
    Posts
    108
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Programmatically displaying Add-Ins tab

    I am trying to programmatically show the Add-Ins tab when excel starts. I also want to hide that tab when excel closes. This is only for a particular workbook. I tried to record the steps with the recorder to no avail. Any guidance or examples will be greatly appreciated.

    DennisK

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    The add-ins tab only shows when you have custom commandbar code.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Blue Springs, Missouri, USA
    Posts
    108
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I did not explain myself well... here is my code...
    Code:
    Private Sub Workbook_Open()
        AddIns("Analysis ToolPak").Installed = True
        AddIns("Analysis ToolPak - VBA").Installed = True
        
        Dim cmbBar As CommandBar
        Dim cmbControl As CommandBarControl
         
        Set cmbBar = Application.CommandBars("Worksheet Menu Bar")
        Set cmbControl = cmbBar.Controls.Add(Type:=msoControlPopup, temporary:=True) 'adds a menu item to the Menu Bar
        With cmbControl
            .Caption = "&Sort" 'names the menu item
            With .Controls.Add(Type:=msoControlButton) 'adds a dropdown button to the menu item
                .Caption = "Sort 1" 'adds a description to the menu item
                .OnAction = "SortFunc_Prog" 'runs the specified macro
                .FaceId = 1098 'assigns an icon to the dropdown
            End With
        End With
    
        
    End Sub
    Again... what is my code to make sure that the "Add-Ins" tab displays. TIA.

    DennisK
    Last edited by RetiredGeek; 2016-06-24 at 20:32. Reason: Added code tags.

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    You don't need any. Simply adding the command bar controls should make the addins tab visible.

Posting Permissions

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