1

Heylo, I am having a rather frustrating issue with my custom Excel Tab. I currently have about 20 buttons that all do a variety of different things, and I would like to implement some menu's to declutter the tab a bit. I have an add-in with a bunch of macros and an embedded customUI.xml file to organize all of the buttons.

The problem is, whenever I try to add what I see as perfectly fine menu xml code to the customUI.xml file, and re-embed it in the add-in, the tab ceases to show up when I reload Excel. Before I put the menu in, the tab is there and everything is fine, but when I add the menu code, it just doesn't want to show up anymore. Below is an example of what I'm trying to do.

<customUI xmlns = "http://schemas.microsoft.com/office/2006/01/customui">
   <ribbon>
      <tabs>
         <tab id = "MyTab" label = "My Tab">
            <group id = "About" label = "About">
               <button id        = "Button1"
                       label     = "About My Tab"
                       size      = "large"
                       onAction  = "AboutMyTab"
                       imageMso  = "Help" 
                       screentip = "About My Tab"
                       supertip  = "Shows a dialog box that displays information about My Tab."
               />
            </group>
            <group id = "TestMenus" label = "My Test Menu">
               <menu id = "MyMenu" label = "The Menu">
                  <button id = "ButtonX" label = "X" size = "large" imageMso = "FileSave" />
                  <button id = "ButtonY" label = "Y" size = "large" imageMso = "Bold" />
                  <button id = "ButtonZ" label = "Z" size = "large" imageMso = "Undo" />
               </menu>
            </group>
         </tab>
      </tabs>
   </ribbon>
</customUI>

Whether I embed the menu in a group or not, it still causes the tab to not show up at all. Is it the schema I am using? I am confused on what I am doing wrong. Also, I am using Excel 2016 if that helps in any way.

Thank you for any help in advance.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
CBK
  • 660
  • 1
  • 7
  • 16
  • For starters, if it is not showing, that means there is an error somewhere ;) Your code seems to be fine - maybe you have a duplicate ID somewhere? If I have such a problem, usually I remove everything and add it back one by one, to pinpoint problematic element. – Pm Duda Aug 13 '18 at 19:08
  • @PmDuda Ha ha thank you. It's just strange because everything is in perfect working order until I add the menu. And I know the Menu ID can't be causing a problem because it's the only one of its kind in the file and all of my id's point to the control they are referencing. I guess I'll just have to do what you said and build it piece-wise until I hopefully find an error. – CBK Aug 13 '18 at 19:59
  • Ok, well I've isolated it down to the addition of the buttons in the menu. If I remove the ButtonX, ButtonY, and ButtonZ code, the group shows up with the menu grayed out... What gives? – CBK Aug 13 '18 at 20:22
  • By the way, try [Ribbon XML Editor](http://novikov.gq/counter_fd/counter_fd.php?file=ribbonxmleditor). – JohnyL Aug 13 '18 at 21:00

1 Answers1

1

You need to remove Size property from buttons in menu and add it to menu itself:

<menu id = "MyMenu" label = "The Menu" itemSize = "large">
    <button id = "ButtonX" label = "X" imageMso = "FileSave" />
    <button id = "ButtonY" label = "Y" imageMso = "Bold" />
    <button id = "ButtonZ" label = "Z" imageMso = "Undo" />
</menu>
Pm Duda
  • 741
  • 5
  • 16