I have created a personal.xlsb and connected the macro's to a custom ribbon in Excel. This works great, but when I want to deploy the solution to my co-worker I got a problem. I can export the custom toolbar and deploy the personal.xlsb to them,but the references in the export toolbar still point to the location where my personal.xlsb is expected.
So now I try to convert this solution to an xlam solution but I cannot get it to work.
The problem is, the macros are working, but I cannot get the custom menu in Excel. It just won't showup, whatever I try.
So to see if I can get it to work, I just created a simple xlam file (book1.xlam) with just one macro showing a message box.
I cannot use the ribbon editor (Custom UI editor) so I have to change the xlam manually to add the necessary file (customUI.xml) and change the [Content_Types].xml.
For this I use 7-zip and add and edit the file inside (I learned the hard way renaming xlam to zip, extract it make the changes, zip it again and rename it to xlam will result in a corrupt file)
So now I have got a plain and simple book1.xlam, but when I add it to Excel no menu item is shown.
the customUI.xml has this content:
<mso:customUI xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui">
<mso:ribbon>
<mso:qat />
<mso:tabs>
<mso:tab id="myTab" label="Awesome functions" insertAfterMso="TabHome">
<mso:group id="customGroup" label="Test Group">
<mso:button id="SaveDocument" label="Click Me" onAction="SaveDocument" visible="true"/>
</mso:group>
</mso:tab>
</mso:tabs>
</mso:ribbon>
</mso:customUI>
saved the file as UTF-8 without BOM
Content of the [Content_Types].xml is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default Extension="bin" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings"/>
<Default Extension="png" ContentType="image/png"/>
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
<Default Extension="xml" ContentType="application/xml"/>
<Override PartName="/xl/workbook.xml" ContentType="application/vnd.ms-excel.addin.macroEnabled.main+xml"/>
<Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>
<Override PartName="/xl/worksheets/sheet2.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>
<Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
<Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>
<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>
<Override PartName="/xl/customProperty1.bin" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty"/>
<Override PartName="/xl/drawings/drawing1.xml" ContentType="application/vnd.openxmlformats-officedocument.drawing+xml"/>
<Override PartName="/xl/vbaProject.bin" ContentType="application/vnd.ms-office.vbaProject"/>
<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
<Override PartName="/xl/customUI/customUI.xml" ContentType="application/vnd.ms-office.customUI+xml"/>
</Types>
In the module RibbonMacro there is only one macro:
Public Sub SaveDocument()
MsgBox "Ribbon button clicked!"
End Sub
And that's it.
When I load this simple addin no tab "Awsome functions" shows up.
I have tried copilot, but all it suggested has been done and checked, but it still doesn't work. No Menu item.
I am on Office 365
Any suggestions.
UPDATE:
While I was still searching the internet I saw a similar question in This link.
Thanks to the answers given in the comments (FaneDuru) I could use the OfficeRibbonEditor (Link to the download). There is no need to install. With the help of this tool I was finally able to show my custom menu.
One thing I noticed. I named my xlam file using a dash like IT-Department.xlam. Apperantly this was the one of the causes it didn't show, because when I renamed the file to ITDepartment.xlam everything started working.
Insert Office 2010+ Custom UI Partand not theInsert Office 2007 Custom UI Part. I just tested it and it works. Placement of Code and Final Result