An Exception (popup is not connected) when adding a button to a popup

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

An Exception (popup is not connected) when adding a button to a popup
 
nir zamir




Posts: 96
Joined: 2006-12-28
Hi,

When I do the following:

1. Create a new Excel COM add-in
2. Add a toolbar (floating commandbar) to it, with a CommandBarPopup inside it.
3. In the "StartupComplete" event, add a button to the CommandBarPopup this way:
ADXCommandBarControl adxNewControl =
adxCommandBarPopup1.Controls.Add(typeof(ADXCommandBarButton),
Guid.NewGuid().ToString(),
1,
0,
true);
adxNewControl.Caption = "Button1";
adxNewControl.AsButton.Style = ADXMsoButtonStyle.adxMsoButtonCaption;

4. Build the setup project
5. Install the setup on a machine
6. Run Excel --> Add-in works fine
7. Run another Excel instance (don't close first one) --> The following exception is thrown:
Exception in AddinModule_AddinStartupComplete:
Reason: The '<popup caption>' popup is not connected.
at AddinExpress.MSO.ADXCommandBarPopupControlCollection.Add(Type controlType, String controlTag, Int32 id, Int32 before, Boolean temporary)


Please note:
1. This does NOT happen if the toobar's Temporary property is True
2. This does NOT happen if you close the first Excel instance and then open the other instance.
3. It happens both on ADX 2.7 and 3.2


Thanks for a quick reply (as always...),
Nir

Posted 27 Mar, 2007 09:02:45 Top
Sergey Grischenko


Add-in Express team


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

I am afraid this issue can't be fixed. It will always happen when you start Excel first time. Please use the IsConnected property of the popup control to check if it is connected.


P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 27 Mar, 2007 09:17:21 Top
nir zamir




Posts: 96
Joined: 2006-12-28
Hi Sergey,
thanks for the quick reply.

OK.

In my add-in (not a blank add-in), if the first Excel instance (where the add-in loaded successfully) is closed first, and only then the second one (where the exception was thrown), Excel will never connect the popup (I always get the exception)!

I don't get the same behavior with a blank add-in, even though in my add-in I removed all ADX event handlers (besides StartupComplete where I add the button).

Any ideas?

Thanks,
Nir
Posted 27 Mar, 2007 10:16:24 Top
Sergey Grischenko


Add-in Express team


Posts: 7235
Joined: 2004-07-05
Nir, can you please send me the project that produces the issue?

Posted 28 Mar, 2007 09:55:34 Top
nir zamir




Posts: 96
Joined: 2006-12-28
I have just sent you an email - we can reproduce it with also a blank add-in (though not on all machines)...

Thanks!
Nir.
Posted 29 Mar, 2007 04:21:03 Top
Sergey Grischenko


Add-in Express team


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

Did you install the latest Windows and Office updates on your PCs?

Posted 29 Mar, 2007 07:20:04 Top
nir zamir




Posts: 96
Joined: 2006-12-28
Sergey,

I checked and it's not related to Windows/Office versions (the same versions on 2 machines behave differently).

Just a reminder of our problem:

After the installation, when opening 2 instances of Excel:
If the first Excel instance (where the add-in loaded successfully) is closed first, and only then the second one (where the exception was thrown), Excel will never connect the popup (I always get the exception)!

Again, it happened in a blank ADX project - I already sent you the sources and I can send you the setup file.

Please help!

Thanks,
Nir.
Posted 16 Apr, 2007 09:36:07 Top
Sergey Grischenko


Add-in Express team


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

I have just sent you an email.
Posted 16 Apr, 2007 13:11:58 Top
nir zamir




Posts: 96
Joined: 2006-12-28
Hi Sergey,
I've sent you an email too:

Were you able to reproduce this behaviour?

Do you have any explanation why it doesn't happen on all machines?

Thanks,
Nir
Posted 18 Apr, 2007 00:48:23 Top
Sergey Grischenko


Add-in Express team


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

Yes, I reproduced it. Do all machines have the same Windows and Office updates?
Posted 18 Apr, 2007 08:45:49 Top