how to handle 'sheetchange' event on 'add-in'

  • Thread starter Thread starter Takoyaki
  • Start date Start date
T

Takoyaki

Hello,
I hope to know how can I handle the sheetchange event on my add-in xla
program?
you know, If I create add-in, It's not part of what I working project.
So, I can't handle the event.
Thanks!
 
Hi Takoyaki,

You could create application events in your add-in, and test for applicable
workbooks.

In the add-in ThisWorkbook module add,

Private Sub Workbook_Open()
Dim AppClass As clsAppEvents

Set AppClass = New clsAppEvents
Set AppClass.App = Application

End Sub

also create a class, call it clsAppEvents, add this line

Public WithEvents App As Application

then run the Workbook_Open code, and in the class dropdown, you will se App
as an object, and then you can select the SheetChange event.


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Thanks Bob!!
I'm really thank you !


Bob Phillips said:
Hi Takoyaki,

You could create application events in your add-in, and test for
applicable
workbooks.

In the add-in ThisWorkbook module add,

Private Sub Workbook_Open()
Dim AppClass As clsAppEvents

Set AppClass = New clsAppEvents
Set AppClass.App = Application

End Sub

also create a class, call it clsAppEvents, add this line

Public WithEvents App As Application

then run the Workbook_Open code, and in the class dropdown, you will se
App
as an object, and then you can select the SheetChange event.


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Back
Top