Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trap Excel Application Events

Status
Not open for further replies.

lalapaul

Programmer
Jul 27, 2004
2
US
In order to trap events of the worksheet that was dynamically generated, I define one class module and one code module like the following:

Class Module:
Public WithEvents xlapp as Application

Public Sub xlapp_SheetPivotTableUpdate(ByVal Wb As Workbook)
MsgBox " Testing Trap Events! "
End Sub


standard module:
Public xlApplication as new ClsAppEvents

Public Sub TrapApplicationEvents()
Set xlApplication.xlapp = Application
End Sub

I call TrapApplicationEvents from auto_open macro to trigger the worksheet's event automatically.

My problem is the pivottableupdate event can not be triggered automatically, I must run the TrapApplicationEvents macro manually every time to trigger the event.

Is there anybody know why?

Thanks
 
I have this problem too, I don't know the solution.

Anyone?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top