ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Persistent menu item with Excel Automation Add-in? (https://www.excelbanter.com/excel-programming/320435-persistent-menu-item-excel-automation-add.html)

[email protected]

Persistent menu item with Excel Automation Add-in?
 
I've seen this addressed a number of times but have yet to see a
satisfying answer - how do we add a persistent Excel toolbar menu item
from a Automation Add-in?

I've built an Automation Add-in that also implements the optional
IDTExtensibility2 interface (in order to take advantage of start up
events). I create a menu item from the OnConnection() method. Here's
what happens:

1) Run Excel.
2) Begin to insert a formula. (OnConnection() doesn't fire until I
enter the first character after the equal sign (e.g., =A))
3) OnConnection runs and installs my menu item.
4) Menu item remains on the toolbar while Excel runs.
5) Save the spreadsheet, quit out of Excel.
6) Run Excel, open saved spreadsheet, menu item is gone...

I'm looking for my menu item to be persistent and to be displayed
either when I start Excel, or when I open a previously saved
spreadsheet from which the menu item had been installed.

What's the proper way to achive this behaviour? (FWIW, I'm using Excel
2003 and C#/.NET)

Thanks,
Steve


Tom Ogilvy

Persistent menu item with Excel Automation Add-in?
 
Does this help?

http://support.microsoft.com/default...b;en-us;241652
FIX: Changes Made to Excel CommandBars Through Automation Are Not Saved

(see the workaround in the second part of the article.).

--
Regards,
Tom Ogilvy


wrote in message
oups.com...
I've seen this addressed a number of times but have yet to see a
satisfying answer - how do we add a persistent Excel toolbar menu item
from a Automation Add-in?

I've built an Automation Add-in that also implements the optional
IDTExtensibility2 interface (in order to take advantage of start up
events). I create a menu item from the OnConnection() method. Here's
what happens:

1) Run Excel.
2) Begin to insert a formula. (OnConnection() doesn't fire until I
enter the first character after the equal sign (e.g., =A))
3) OnConnection runs and installs my menu item.
4) Menu item remains on the toolbar while Excel runs.
5) Save the spreadsheet, quit out of Excel.
6) Run Excel, open saved spreadsheet, menu item is gone...

I'm looking for my menu item to be persistent and to be displayed
either when I start Excel, or when I open a previously saved
spreadsheet from which the menu item had been installed.

What's the proper way to achive this behaviour? (FWIW, I'm using Excel
2003 and C#/.NET)

Thanks,
Steve




[email protected]

Persistent menu item with Excel Automation Add-in?
 
Tom,

Thanks for the quick reply. I understand the solution they're
proposing, but it seems to be a temporary workaround for a problem that
was resolved with this update "Microsoft Office 2000 Service Release
1/1a (SR-1/SR-1a)", also mentioned in the article.


Since I'm running Office Pro 2003 I'd like to think this fix was
propagated, so perhaps there's another solution.

Thanks,
Steve



All times are GMT +1. The time now is 01:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com