ActiveX textbox stops custom Ribbon (fluent UI) from working

Started by daihashi, April 05, 2014, 08:01:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I wasn't quite sure where to post this one, so I decided to just post in the general visio forum.

So I've been going through my templates and trying to polish it so that it has more of a "professional" look and feel to it. Part of this effort involves using RibbonX/Fluent UI so that the macros that are currently only accessible via a right click, can also be accessible on the ribbon. Everything works unless I click a button on the ribbon that calls a macro that drops a stencil that contains an activex text box. It successfully runs the macro, but after that none of the buttons will work.

All of the buttons work until I click one that is related to a macro that drops the activex text box. I can't seem to figure out why this is happening, or how to fix it. Has anyone encountered this, or can anyone at least point me in the right direction of what I should be looking for to solve this?





Quote from: Yacine on April 05, 2014, 09:47:23 PM
an un-catched error stopping the ribbon???

Let me check; I'll try to step through it and see what I can find. The same macro runs perfectly fine via shapesheet actions or action tags, and I can run it as many times without fail.

What's particularly odd is that the activeX textboxes act as if the document is in design mode, but if I activate design mode and then turn it off again then the activeX boxes work; unfortunately this does not also fix the buttons on the ribbon. They will only work again upon closing and re-opening the document.

I'll look through my code again more carefully and report back.


It seems like I am getting an error, but it happens right on "End Sub" of the Macro that get's called.  The only error I receive is "Cannot Enter Break mode at this time". I could not find anything wrong with the code itself, however after poking around a bit in the VBA editor it seems like the reference for ActiveX Data Object is getting removed/unchecked. This only happens when I run the macro from the ribbon via iRibbonControl; if I run the macro manually or via shapesheet action then the reference does not get removed.

updated: Actually I apologize, but my statement above is not true. I was actually looking at another VBA project references and didn't realize it. Now I really don't have any idea as to why this is happening. :(


I've attached a stripped down version of my document here. The code is in the document, and you can see the error by placing a breakpoint as shown in the attached image.. inside the ribbon class module, and then step through the rest of the code. For some reason this version actually generates the error immediately upon dropping the stencil, as opposed to on "end sub" in the version I am trying to fix.

I have other masters that also have activex controls, and the custom ribbon/buttons also stop working when I invoke those via the fluent UI ribbon as well. So it's not specific to the stencil in this particular example file, it does it on any stencil that uses an ActiveX text box.


just a thought .. check the documents add_shape event 
what version of Visio is this ?