Hi All
I have a workbook with quite an extensive custom ribbon, with many getvisible & getPressed callbacks.
What I am finding is when changing workbooks, sometimes it all works seamlessly, with the custom tabs disappearing as they should. But sometimes I get an error "cannot run the macro 'blahblahblah'. The macro may not be available in this workbook or all macros may be disabled.". This doesn't occur all the time. Anyone have any info on how to avoid this or head me in the right direction?
If I comment out all of the code to refresh certain ribbon controls it seems to fix the issue, so this is the root cause of the problem, however then all of the ribbon controls do not update dynamically when the ribbon is refreshed when other code calls for the ribbon to be refreshed. I believe the refresh is triggered by changing the workbook, but then it finds no macros in the new workbook or something.
i.e. comment out multipleHow would I make excel refresh the individual controls when working in the workbook with the ribbon, but not have the refresh trigger when another workbook becomes the active workbook?Please Login or Register to view this content.
Due to the nature of some of the controls being used, I have Worksheet_SelectionChange and Workbook_SheetActivate events that call for the ribbon to be refreshed/invalidated when changing cells and/or sheets in the workbook so toggle buttons and visibility of ribbon controls update correctly.
Thanks!
Bookmarks