Results 1 to 4 of 4

Thread: Hijacking the RibbonX Onload event

  1. #1

    Hijacking the RibbonX Onload event

    Register for a FREE account, and/
    or Log in to avoid these ads!

    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?

  2. #2
    Super Moderator Bob Phillips's Avatar
    Join Date
    Mar 2011
    Excel Version
    Your workaround is how I do it. I wrote a couple of blogs about it.

  3. #3
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Nanaimo, BC, Canada
    Blog Entries
    Excel Version
    Excel Office 365 Insider
    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.
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: -||- Blog: -||- Forums:
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  4. #4

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts