To clearly explain how I created the workbook, here are the steps that I
made, based on the MSDN site:
1. I created a new workbook and saved it as "Custom.xlsm"
2. I opened the VB Editor and in "ThisWorkbook", added the ff. code:
Sub MyButtonMacro(ByVal ControlID As IRibbonControl)
Msgbox("Hello world")
End Sub
3. I saved the worksheet.
4. At my own specified folder, I created a folder, "customUI".
5. Under the "customUI" folder, I created an xml file called "customUI.xml"
having the ff. code:
<?xml version="1.0" encoding="utf-8" ?>
<customUI xmlns="
http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="true">
<tabs>
<tab id=":CustomTab" label="My Tab">
<group id="SimpleControls" label="Sample Group">
<button id="Button1" size="large" label="Large Button"
onAction="ThisWorkbook.MyButtonMacro" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
6. I renamed "Custom.xlsm" to "Custom.xlsm.zip" to see the contents.
7. I added my "customUI" folder (together with the file under it) into the
zip file, just directly under "Custom.xlsm.zip".
8. I extracted the ".rels" file which is under the "_rels" folder in the zip
file.
9. I modified the ".rels" file to add the ff. xml tag as another item under
the "Relationships" tag:
<Relationships>
....
<Relationship Id="someID"
Type="
http://schemas.microsoft.com/office/2006/relationships/ui/extensibility" Target="customUI/customUI.xml" />
</Relationships>
10. I added the ".rels" file back into the zip file, under the "_rels"
folder, overwriting the existing file.
11. I renamed the zip file back into "Custom.xlsm" and opened it.
However, after accomplishing these steps, I did not see "My Tab" at the UI.