Results 1 to 2 of 2
  1. #1
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts

    Excel 2010 Interface Change?

    Hey Y'all,

    I just noticed this yesterday and I'm not sure if it's just my memory or something has actually changed.

    I have several legacy .xls files that have custom toolbarss. With the advent of the ribbon they would show up in the Add-ins tab. So I moved the Addins tab to the right of the File tab.

    As I remember it if a given Workbook did NOT have a custom toolbar the Add-ins tab would not show. However, in the last day or so it shows either way.

    With Custom Toolbar:
    MenuAdd-ins.PNG

    Without Custom Toolbar:
    BlankAdd-ins.PNG

    What's even funnier is that a second section showed up under the Add-ins tab for Menu Commands and my toolbar would show up there! I've made some code changes so that no longer happens so unfortunately I can't show you a picture of that configuration.

    Edit: Tried it on another machine and it's still there
    MenuCmds.JPG

    Here's the base code I use to create the Custom Toolbar:
    Code:
    '                         +-------------------------+             +----------+
    '-------------------------|   ApplicationMenu()     |-------------| 02/18/16 |
    '                         +-------------------------+             +----------+
    'Called by: Auto_Open
    
    Sub ApplicationMenu()
    
       Dim myMenuBar As Object
       Dim newMenu   As Object
       Dim ctrl      As Object
       Dim oWkBk     As Workbook
        
       KillApplicationMenu "Images Menu"  'Deletes menu bar if it exists before recreating
    
       Set oWkBk = ActiveWorkbook
    
       Set myMenuBar = _
          CommandBars.Add("Images Menu", msoBarLeft + msoBarTop, , True)
       myMenuBar.Visible = True
       Set newMenu = _
          myMenuBar.Controls.Add(Type:=msoControlPopup, temporary:=True)
       newMenu.Caption = "Images Menu"
    
       If Not oWkBk.ReadOnly Then
         Set ctrl = newMenu.CommandBar.Controls.Add(Type:=msoControlButton, ID:=1)
         With ctrl
             .Caption = "&Read Image drive"
             .TooltipText = "Scan selected drive for image files."
             .Style = msoButtonCaption
             .OnAction = "ImportImageBackupList"
         End With
       End If
       
       Set ctrl = newMenu.CommandBar.Controls.Add(Type:=msoControlButton, ID:=1)
       With ctrl
           .Caption = "&Delete Image Drive"
           .TooltipText = "Remove Image Drive from Table"
           .Style = msoButtonCaption
           .OnAction = "DeleteImageDrive"
       End With
       
       Set ctrl = newMenu.CommandBar.Controls.Add(Type:=msoControlButton, ID:=1)
       With ctrl
           .Caption = "&Setup"
           .TooltipText = "Add/Remove Drive(s) to Image"
           .Style = msoButtonCaption
           .OnAction = "Setup"
       End With
    
       Set ctrl = newMenu.CommandBar.Controls.Add(Type:=msoControlButton, ID:=1)
       With ctrl
          .Caption = "&Quit - No Save"
          .TooltipText = "Exit Auto-Image Backup Log w/o saving changes."
          .Style = msoButtonCaption
          .OnAction = "ExitQuit"
       End With
    
       Set ctrl = newMenu.CommandBar.Controls.Add(Type:=msoControlButton, ID:=1)
       With ctrl
           If ActiveWorkbook.ReadOnly Then
             .Caption = "&Exit - No Save"
           Else
             .Caption = "Save and &Exit"
           End If
          .TooltipText = "Exit Auto-Image Backup Log and save data"
          .Style = msoButtonCaption
          .OnAction = "ExitSave"
       End With
       
    End Sub                   'ApplicationMenu()
    
    '                         +-------------------------+             +----------+
    '-------------------------|  KillApplicationMenu()  |-------------| 09/03/14 |
    '                         +-------------------------+             +----------+
    'Version: 1.0
    
    Function KillApplicationMenu(zControlCaption As String)
    
       Dim mbTest   As Object  'Menu Bar Class
       Dim xControl As Object  'Control Class
       
       Set mbTest = CommandBars.ActiveMenuBar
       
       For Each xControl In mbTest.Controls
          '**** Change Caption below as necessary ****
          If xControl.Caption = zControlCaption Then
            xControl.Delete
          End If
       Next
       
    End Function              'KillApplicationMenu
    So is this just a case of bad memory or what?

    Last edited by RetiredGeek; 2016-02-19 at 11:27.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  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 Menu Commands item should appear only if you create new commands on an existing commandbar, rather than creating a new one and adding to that.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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