1

I am trying to create a new ribbon with 2 buttons in Excel 2013. I was able to create it using Custom UI editor thanks to Excel CustomUI ribbon layout and How to add a custom Ribbon tab using VBA?

When I input the code as

<button id="aa" label="CORE"  onAction = "HMA_CORE"/> 

it works but once I try this code

<button id="aa" label="CORE" size = "large" onAction = "HMA_CORE"/>

and then click validate in the customUI it says that "size attribute is not declared". I am not sure what to add. I saw http://www.rondebruin.nl/win/s2/win009.htm as well, but the code looks the same. Any help will be appreciated. Thanks

The code for the buttons looks like this

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
   <ribbon>
      <tabs>
         <tab id="toolRibbon" label="HMA-FUNCTIONS">
            <group id="groupDocument" label="HMA-xml outputs">
               <buttonGroup id="a">
                  <button id="aa" label="CORE" onAction = "HMA_CORE"/>
                  <button id="ab" label="PLANT" onAction = "HMA_PLANT"/>
               </buttonGroup>
            </group>
         </tab>
      </tabs>
   </ribbon>
</customUI>
Community
  • 1
  • 1
Vatsa
  • 48
  • 1
  • 1
  • 6
  • please show more lines, from ` – PatricK Sep 13 '13 at 01:39
  • 1
    you can only use `size="large"` if the button is under ``, if it is under `` then put `itemSize="large"` in the menu line. – PatricK Sep 13 '13 at 02:27
  • @PatricK: I have not used the tag in my code (I have added the full code). But just in case I tried 'itemSize = "large"' , but I get the same error. – Vatsa Sep 13 '13 at 13:29

2 Answers2

2

Give this a try using built in icons from Office (get rid of buttonGroup)

enter image description here

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
   <ribbon>
      <tabs>
         <tab id="toolRibbon" label="HMA-FUNCTIONS" insertBeforeMso="TabHome">
            <group id="groupDocument" label="HMA-xml outputs">
                  <button id="aa" label="CORE" imageMso="MacroArguments" onAction = "HMA_CORE" size="large" />
                  <button id="ab" label="PLANT" imageMso="PictureBrightnessGallery" onAction = "HMA_PLANT" size="large" />
            </group>
         </tab>
      </tabs>
   </ribbon>
</customUI>

Reference: Office 2007 Icons Gallery

PatricK
  • 6,375
  • 1
  • 21
  • 25
  • That worked well. Thanks! However any idea why button group did not work? – Vatsa Sep 16 '13 at 15:57
  • `buttonGroup` is meant to consume minimal space and join the buttons together, just like the default's Bold, Italic, Underline... on home tab Font group. – PatricK Sep 17 '13 at 00:38
  • Oh, okay so using a 'Buttongroup' prevents the user from re-sizing the button size. – Vatsa Sep 17 '13 at 15:21
0

the problem was the space between the "size" and the "larger" statement! put it all together

error >> size = "larger"

correct >> size="larger"