View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
HLong HLong is offline
external usenet poster
 
Posts: 6
Default Creating An Application Event Handler

I am not very familiar with Excel Addins jet. I am trying to create an addin
with an event handler that will fire up on Application.SheetChange. I create
a class object and declared a variable withevents, then added the event
handler. Also, created a module object with two routines to instantiate and
terminate the class object. Here is where I got lost, if I instantiate the
class thru a routine on ThisWorkbook object, everything works fine. However,
if I create an addin thisWorkbook will never be active and the class object
can't be instantiated. So, my problem is: How do I instantiate this class so
the application events are fired when any workbook is opened. I need to fire
these events at all time. I don't know if this is the correct approach. All
suggestions will be greatly appreciated.