GLobal Ribbon Object

hatman

Well-known Member
Joined
Apr 8, 2005
Messages
2,664
For my Custom UI Ribbon, which needs to have controls invalidated occasionally, I used the following code, according to standard protocol:

Code:
Global grxLabStatusRibbon As IRibbonUI
 
Sub Callback_LabStatusRibbon_******(ribbon As IRibbonUI)
 
    SetActiveWindow Application.hwnd
        
    Application.SendKeys "%HAM{RETURN}"
 
    Set grxLabStatusRibbon = ribbon
 
End Sub

The problem is that in my current version of the software, I seem to have at least one unhandled error (that none of my users are reporting, and I can't duplicate) that causes all of my globals to get cleared. While I can detect this, and re-assign all of my globals at the start of each entry-point, I can't see a way to do this for the RibbonUI object. I can display a messagebox before the Invalidate method is called and instruct the user to restart the application, so the error is handled with grace... but I'd like to handle the error invisibly by re-assigning the Custom Riboon to the RibbonUI object on teh fly.

Anybody else run into this? Anybody find a more robust solution than what I have in place now?
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,224,508
Messages
6,179,188
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top