I am trying to build a dynamic ribbon in Excel 2007. I can find lots of examples on the web of ribbon buttons that change image when the button is pressed (essentially they toggle). However, I want to change the button based on the contents of a particular workbook. I already have a function that checks anytime a workbook is activated to see if that workbook is of what we will call "SpecialType".
It looks something like:
My ribbon code looks something like:Please Login or Register to view this content.
I have followed the directions for changing labels (close enough) on several websites: http://www.rondebruin.nl/win/s2/win009.htm or http://gregmaxey.mvps.org/word_tip_p...bbon_main.htmlPlease Login or Register to view this content.
The problem is they all initiate the image change by something else in the ribbon and so cleanly pass the ribbon id around. I need to initiate by my xlApp_WorkbookActivate and then set the image in the ribbon.
They (and I here) have a GetImage function that requires the IRibbonControl, and since I haven't pressed a button on the ribbon, I don't have it! (I think...)
Basically, I have all the pieces from these other websites, but since my application is slightly different, I can't figure out how to tie the pieces together!Please Login or Register to view this content.
This guy ALMOST solved it for me in Question 3 on http://excelusergroup.org/blogs/nick...he-ribbon.aspx
Unfortunately, he only sets the image initially. He was asked in the 5th comment how to update the ribbon when a change occurred, but he didn't answer. If someone could even answer the question the way it was asked in that blog, I could probably figure out how to apply it to my need!
Thanks!
Bookmarks