View Full Version : Hijacking the RibbonX Onload event

2011-08-22, 08:04 PM
So I have written a pretty extensible add-in which has a couple of tabs and mutliple commands across those tabs. I'm now being told that the users need the ability to customize which commands they see, the order they are presented, etc. I can easily create forms to let them administer this, and store what would be the resulting customUI.xml out to a file.
My question is this:
Is there anyway to load XML using an interface into the ribbon during the onload event of the ribbon?

So far the only possible solution I have come up with, short of telling the users no, is to create a workbook with an open_workbook event that would build the customUI, unzip the add-in, do a switch-er-oo on the xml file, zip it back up then open the add-in and close the initial workbook.

This just seems like a lot of added complexity, especially if there is some easily accessible interface for updating the ribbon. So far I have seen some references to the Office.IRibbonExtensibility.GetCustomUI in regards to building a COM Add-In in VSTO, however it does appear in the package viewer in the VBA IDE. I just can't figure out how to implement it.

Anyone know how I can implement this interface or know of some other way to hijack the ribbon's onload event to add some customUI xml to the ribbon?

Bob Phillips
2011-08-23, 01:28 AM
Your workaround is how I do it. I wrote a couple of blogs about it.

Ken Puls
2011-08-23, 07:33 AM
The only way to do this inside Excel (without going to VSTO or the route you've described) is through the DynamicMenu controls. I'd love to see a "DynamicUI" that would let us reload the entire XML on the fly, but unfortunatetly it's not there yet. :(

2015-11-19, 08:12 PM