keren friedman
Posts: 16
Joined: 2006-07-27
|
Hi,
I am using the Addin-Express .Net (VS 2005) for an Excel add-in.
My add-in includes a menu and a toolbar, whose buttons state (enabled/disabled, icon etc.) changes upon user actions.
The scenario is:
1) Open Excel
2) Disable a button (of the add-in, enabled by default)
3) Close Excel
4) Open Excel -> The button is still disabled!
However, when you disable and enable the add-in (through "COM add-ins") the button is initialized to its correct state (enabled).
Why is this, and is there a workaround besides initializing all the UI controls on "BeginShutdown" or something like that?
Thanks!
|
|
Sergey Grischenko
Add-in Express team
Posts: 7235
Joined: 2004-07-05
|
Hi Keren.
It happens because command bars/controls are not removed from Excel when it closes. Please unregister the add-in and set the Temporary property of the ADXCommandBar component to true. Then you need to register the add-in and run Excel. In this case all controls will be added every time when the host application starts.
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.
|
|
keren friedman
Posts: 16
Joined: 2006-07-27
|
Thanks, it works. Does it mean that the initialization of the Excel will take longer?
Speaking of which, I noticed that it takes a VERY long time for the Excel to initialize when the add-in is enabled, especially after the machine is restarted.
Do you have any idea why it happens, and if there's anything we can do about it?
Thanks. |
|
Sergey Grischenko
Add-in Express team
Posts: 7235
Joined: 2004-07-05
|
Hi Keren.
Yes, Excel will load a bit slower if the Temporary property = true.
After you restart the PC, Excel needs a bit more time to initialize the .NET Framework runtimes. So it is normal for managed COM add-ins. |
|