Excel - Buttons in CommandBarPopup are sometimes not removed

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

Excel - Buttons in CommandBarPopup are sometimes not removed
 
nir zamir


Guest


Hi,

Sometimes the add-in goes to a state where buttons that were added dynamically to CommandBarPopups in MenuBar and ToolBar of the add-in are not removed when re-opening Excel. I tried making the ManuBar and ToolBar "Temporary" but it didn't help.

The only thing that helped was unchecking the add-in from the COM add-ins, and then checking it again.
Now it doesn't happen anymore (even after un-setting the "Temporary" properties).

How can this situation be prevented?

Please let me know if you need any additional info.

Thank you,
Nir
Posted 08 Jan, 2007 05:55:57 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Nir, you needed to delete controls via the Customize dialog before you changed the Temporary property. The issue happened bacause your controls
had already been added with Temporary = False.


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 08 Jan, 2007 10:37:12 Top
nir zamir


Guest


Thanks Sergey. I understand.

What I don't understand is why the controls were there in the first place. I cleared the popup command bar (controls.Clear()) but it didn't cause the buttons to be removed... Do you have any idea what can cause it?

Also, do you recommend using temporary controls in general (considering initialization time)?

Nir.
Posted 09 Jan, 2007 01:57:07 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Nir, are you sure that the controls were connected before you called the Clear method?
I recommend to use temporary controls if they are created at runtime.
Posted 09 Jan, 2007 09:22:56 Top
nir zamir


Guest


How can controls become not connected?

If I use temporary controls, will it prevent such a scenario?

Thanks,
Nir.
Posted 14 Jan, 2007 02:58:01 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Nir, the temporary controls should prevent the issue.
However not temporary controls should work properly as well. Please look at the following example:
http://www.add-in-express.com/projects/oldynamiccontrolsexample-vs2005.zip
It is written for Outlook but you can use the same code in Excel with minimum changes.
Posted 15 Jan, 2007 15:40:59 Top