Load different RibbonX when opening file in Excel 2007 or 2010
If you want to insert RibbonX into a Excel 2007-2010 workbook, then I suggest you
download
the new version of the Custom UI Editor here:
http://openxmldeveloper.org/archive/2006/05/26/CustomUIeditor.aspx
This version of the Custum UI Editor gives you an option to insert a customUI.xml file for Excel 2007-2010
and/or a customUI14.xml file only for Excel 2010 into your 2007-2010 workbook.
When you do not want to work with new stuff from Excel 2010 (like Backstage View for example), then you can
use the Office 2007 Custom UI Part option to add your RibbonX to workbooks that you use in Excel 2007
and Excel 2010. If there is no customUI14.xml file when you open the workbook in Excel 2010, it will load
the customUI.xml file.
But if you want to insert (for example) a button in the Office Button menu when you open your file in Excel 2007 and a button in Backstage View when you open the workbook in Excel 2010, then you must insert the RibbonX in both the xml files with the Custum UI Editor.
When you open a Excel file in the Custom UI Editor you can right click on the file name and choose :
Office 2007 Custom UI Part Or use Office 2010 Custom UI Part
Or you can use the Insert menu to choose one of the two options.

It creates the customUI14.xml file if you choose Office 2010 Custom UI Part and
the customUI.xml file if you choose Office 2007 Custom UI Part. After you choose
one option or both, you can enter or paste your RibbonX in the right window.
In the screenshot shown below, you see that I used both options:

Example 1
This example adds RibbonX that creates a button in the Office Button menu when you open your
file in Excel 2007 and a button in Backstage View when you open the workbook in Excel 2010.
1: Open a new workbook and save it as Book1.xlsm
2: Close the workbook
3: Open Book1.xlsm in the Custom UI Editor
4: Right click on the File name in the Custom UI Editor
5: Choose "Office 2010 Custom UI Part"
6: Choose "Office 2007 Custom UI Part"
7: Paste the RibbonX below in the customUI14.xml file for Excel 2010
10: Close the Editor
11: Open the File in Excel
12: Alt F11
13: Insert Module
14: Copy the macro below in the Module
16: use Alt q to close the VBA editor
17: Test the workbook in 2007 and in 2010
If you do it correctly, you see a button on top of the Office Button menu in Excel 2007
and a button on top of Backstage View in Excel 2010.
More information
See this two sections :
Excel 2007 Ribbon and QAT pages
Excel 2010 (Beta)
On my Tips index page
http://www.rondebruin.nl/tips.htm
the new version of the Custom UI Editor here:
http://openxmldeveloper.org/archive/2006/05/26/CustomUIeditor.aspx
This version of the Custum UI Editor gives you an option to insert a customUI.xml file for Excel 2007-2010
and/or a customUI14.xml file only for Excel 2010 into your 2007-2010 workbook.
When you do not want to work with new stuff from Excel 2010 (like Backstage View for example), then you can
use the Office 2007 Custom UI Part option to add your RibbonX to workbooks that you use in Excel 2007
and Excel 2010. If there is no customUI14.xml file when you open the workbook in Excel 2010, it will load
the customUI.xml file.
But if you want to insert (for example) a button in the Office Button menu when you open your file in Excel 2007 and a button in Backstage View when you open the workbook in Excel 2010, then you must insert the RibbonX in both the xml files with the Custum UI Editor.
When you open a Excel file in the Custom UI Editor you can right click on the file name and choose :
Office 2007 Custom UI Part Or use Office 2010 Custom UI Part
Or you can use the Insert menu to choose one of the two options.

It creates the customUI14.xml file if you choose Office 2010 Custom UI Part and
the customUI.xml file if you choose Office 2007 Custom UI Part. After you choose
one option or both, you can enter or paste your RibbonX in the right window.
In the screenshot shown below, you see that I used both options:

Example 1
This example adds RibbonX that creates a button in the Office Button menu when you open your
file in Excel 2007 and a button in Backstage View when you open the workbook in Excel 2010.
1: Open a new workbook and save it as Book1.xlsm
2: Close the workbook
3: Open Book1.xlsm in the Custom UI Editor
4: Right click on the File name in the Custom UI Editor
5: Choose "Office 2010 Custom UI Part"
6: Choose "Office 2007 Custom UI Part"
7: Paste the RibbonX below in the customUI14.xml file for Excel 2010
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<backstage>
<button id="MyCustomButton1" insertBeforeMso="FileSave" label="My Macro"
imageMso="HappyFace" isDefinitive="true" onAction="Macro1"/>
</backstage>
</customUI>
8: Paste the RibbonX below in the customUI.xml file for Excel 2007<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<officeMenu>
<button id="MyCustomButton1" insertBeforeMso="FileNew" label="My Macro"
imageMso="HappyFace" onAction="Macro1" />
</officeMenu>
</ribbon>
</customUI>
9: Save your changes in the Custom UI Editor (click on the Save button)10: Close the Editor
11: Open the File in Excel
12: Alt F11
13: Insert Module
14: Copy the macro below in the Module
Sub Macro1(control As IRibbonControl)
MsgBox "Hi There"
End Sub
15: Click on the Save button in the VBA editor16: use Alt q to close the VBA editor
17: Test the workbook in 2007 and in 2010
If you do it correctly, you see a button on top of the Office Button menu in Excel 2007
and a button on top of Backstage View in Excel 2010.
More information
See this two sections :
Excel 2007 Ribbon and QAT pages
Excel 2010 (Beta)
On my Tips index page
http://www.rondebruin.nl/tips.htm