Ribbon toggle button issues

X

xp

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top