Excel Add-in toolbar button stops firing event

S

sreedhardasi

Hi,

I am developing an Add-in for Excel 2003 (Standard & Professional)
using Visual Studio .NET 2003 and C#. I am creating a custom toolbar
with event handler that gets fired when toolbar button is clicked. The
event handler creates an object of another class and calls the method
in it. The issue is that the button stops getting fired after sometime.
It is probably getting garbage collected by .NET runtime.

Does anybody know solution for this issue? Any help would be
appreciated.

Thanks
 
C

Cindy M.

I am developing an Add-in for Excel 2003 (Standard & Professional)
using Visual Studio .NET 2003 and C#. I am creating a custom toolbar
with event handler that gets fired when toolbar button is clicked. The
event handler creates an object of another class and calls the method
in it. The issue is that the button stops getting fired after sometime.
It is probably getting garbage collected by .NET runtime.

Does anybody know solution for this issue?
Assuming you've properly diagnosed the problem, yes. Declare the object
variables that shouldn't get GC'd at the class level.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top