ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Ribbon toggle button issues (https://www.excelbanter.com/excel-programming/436934-ribbon-toggle-button-issues.html)

XP

Ribbon toggle button issues
 
I have two custom toggle buttons on the ribbon and they work sometimes but it
is very clunky. When I first open the file the ribbon works.

But it seems sometimes if I switch to another file and/or do some other
tasks, then go to use either toggle, I get "Object variable or with block
variable not set". If I close and reopen the ribbon file again it works again
--- for awhile.

The error is on this line: gRibbonUI1.InvalidateControl ("rxTB1")

I think the variable gRibbonUI1 which is set to "ribbon" is falling out of
scope (gRibbonUI1 is declared at module level as a Public variable). But, if
this is the case, then any code requiring invalidation of the ribbon is
unstable and basically useless...unless of course my code is goofed up, which
is highly possible.

Can anyone help me through this issue?

Thanks!


All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com