ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to handle 'sheetchange' event on 'add-in' (https://www.excelbanter.com/excel-programming/319246-how-handle-sheetchange-event-add.html)

Takoyaki

how to handle 'sheetchange' event on 'add-in'
 
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!


Bob Phillips[_6_]

how to handle 'sheetchange' event on 'add-in'
 
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)


"Takoyaki" wrote in message
...
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!




Takoyaki

how to handle 'sheetchange' event on 'add-in'
 
Thanks Bob!!
I'm really thank you !


"Bob Phillips" wrote in message
...
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)


"Takoyaki" wrote in message
...
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!






All times are GMT +1. The time now is 06:42 AM.

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