The popup is not connected

Add-in Express™ Support Service
That's what is more important than anything else

The popup is not connected
 
Nir Zamir


Guest


Hi,

please refer to topic #1463, where I noted that I'm getting complaints from some clients getting the "popup is not connected" exception when adding buttons to a popup menu.

The ADX version is 3.2.1865.

My questions:
1. What can cause this issue suddenly (after working with the plug-in)?
2. How can one recover from it? So far, the only way I know is re-install. Will running regsvr32 against adxloader.dll work?

Thanks,
Nir.
Posted 07 Aug, 2007 09:00:58 Top
Nir Zamir


Guest


Any idea?
Posted 16 Aug, 2007 10:08:31 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nir.

1. What can cause this issue suddenly (after working with the plug-in)?

Do you add buttons at runtime? Please send me the code that reproduces the issue. I will test it.

2. How can one recover from it? So far, the only way I know is re-install.

Please try to disable the add-in via the COM Add-ins dialog and then enable it again.
You can also unregister the add-in running the 'regsvr32 /u adxloader.dll' command line and then registered it again running the 'regsvr32 adxloader.dll' one.


P.S. We always do our best to answer your forum requests as soon as possible. However, we apply the rule "first in first out" with Premium Support Service subscribers taking priority. Please understand it may take us some time to do research on the issue. Please be assured we will let you know as soon as the best possible solution is found.
Posted 17 Aug, 2007 19:05:48 Top
Nir Zamir


Guest


Do you add buttons at runtime?

Yes. Do you want the code that causes the error or the code that adds the buttons?
I'll say again - the error rarely happens, but it does.

Please try to disable the add-in via the COM Add-ins dialog and then enable it again

I can't do it in Excel 2003 because my add-in is registered for all users
(and doesn't appear in the dialog).
Posted 19 Aug, 2007 04:54:31 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nir.

I need the code that causes the error so that I could test it on my PC.
Posted 20 Aug, 2007 14:51:16 Top
Nir Zamir


Guest


Here's the code:


        private ADXCommandBarControl AddMenuItemButton(ADXCommandBarPopup menu, string buttonCaption)
        {
            ADXCommandBarControl adxNewControl =
                menu.Controls.Add(typeof(ADXCommandBarButton),
                                Guid.NewGuid().ToString(),
                                1,
                                0,
                                true);
            adxNewControl.Caption = buttonCaption;
            adxNewControl.AsButton.Style = ADXMsoButtonStyle.adxMsoButtonCaption;

            return adxNewControl;
        }


(the call to Controls.Add throws the exception).

Thanks,
Nir.

Posted 22 Aug, 2007 06:00:15 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nir.

Is the code above run from the same popup menu or from another button placed on the command bar?

Please try to modify the code as shown below:

private ADXCommandBarControl AddMenuItemButton(ADXCommandBarPopup menu, string buttonCaption)
{
ADXCommandBarControl adxNewControl = null;
if (menu.IsConnected)
{
adxNewControl =
menu.Controls.Add(typeof(ADXCommandBarButton),
Guid.NewGuid().ToString(),
1,
0,
true);
adxNewControl.Caption = buttonCaption;
adxNewControl.AsButton.Style = ADXMsoButtonStyle.adxMsoButtonCaption;
}

return adxNewControl;
}

Posted 22 Aug, 2007 12:46:16 Top
Nir Zamir


Guest


Hi Sergey,

The code is run from various places - "StartupComplete" event, pressing another button in the commandbar/toolbar etc. Usually we catch the exception on the "StartupComplete" event and if I'm not mistaken the command bar stay not connected even after that event.

What you suggest will prevent the exception but will still make the button missing, correct?

We'd really appreciate your help here. It happens quite a lot to our customers, but we have trouble finding a scenario that reproduces it.

Thanks!
Nir.
Posted 11 Sep, 2007 03:42:15 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nir.

Please try to use the OnSendMessage event handler to modify the popup.
You need to use the SendMessage method of the addinmodule to send a custom message and intersept it in the OnSendMessage event handler.
Posted 11 Sep, 2007 10:35:41 Top
Nir Zamir


Guest


OK, I will try.
Do you think it should also apply to Excel 2007 controls?

However, if I'm not mistaken, when it happens, the existing buttons of the menu are not responding either, so the problem might be the state of the menu and not the update operation.

Thanks,
Nir.
Posted 12 Sep, 2007 04:16:52 Top