Add button on existing Excel 2007 ribbon Through XML you can add your own buttons to the Excel 2007 ribbon interface. It is easiest to use the Office 2007 Custom UI Editor.
First, create a new blank Excel document and save it e.g. as book1.xlsx.
Then open it in the Office 2007 UI Editor.
Add the XML and save the file.
Open the .xlsx file in Excel. Excel will interpret the XML and display the new button.
Example 1: A new button "Click Me" in a new group MyGroup in the home tab:
Code:<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="RibbonOnLoad">
<ribbon>
<tabs>
<tab idMso="TabHome" >
<group id="MyGroup" label="MyGroup">
<button id="MyBtn" label="Click Me" size="large" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Example 2: Add a new button "Click Me" to the end of the Office Menu.
Code:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="RibbonOnLoad">
<ribbon>
<officeMenu>
<button id="MyBtn" label="Click Me" />
</officeMenu>
</ribbon>
</customUI>
Example 3: Add a new button "Click Me" to the Office Menu just after the File Save button.
Code:<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="RibbonOnLoad">
<ribbon>
<officeMenu>
<button id="MyBtn" label="Click Me" insertAfterMso="FileSave"/>
</officeMenu>
</ribbon>
</customUI>