Respond to an event
virtual void Update( CXlAfterCalculateEventArgs* e ); |
A pointer to an event arguments object is sent to the Update method.
Derived classes should implement this function, which is the event handler for the XLL+ event model.
Note that this event is only available when running under Excel 2010 (Excel 14) or above.
The code below defines a class derived from CXlCalculateEventStaticObserver, implements an Update method which is called when the event occurs, and instantiates an instance of the new class.
// Define a class derived from CXlAfterCalculateEventStaticObserver class CMyAfterCalculateEventObserver : CXlAfterCalculateEventStaticObserver { public: // This method will be called during the XlAfterCalculate event. virtual void Update(CXlAfterCalculateEventArgs* e) { CXllApp::XlMessageBox(_T("Calculation complete"), XlMessageBoxTypeInformation); } }; // Create an instance of the class CMyAfterCalculateEventObserver myAfterCalculateObserver;
Header: xlpevents.h
CXlAfterCalculateEventStaticObserver Class | CXlAfterCalculateEventStaticObserver Methods