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
    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
    Location
    Nanaimo, BC, Canada
    Posts
    2,021
    Articles
    79
    Blog Entries
    14
    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 (Excel)

    Master your data with Power Query: Purchase your copy of my book M is for Data Monkey today!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/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
  •