XLL+ Class Library (6.3)

CXlCalculateEventStaticObserver::Update

Respond to an event

virtual void Update(
   CXlWorksheetEventArgs* e
);

Parameters

e

A pointer to an event arguments object is sent to the Update method.

Remarks

Derived classes should implement this function, which is the event handler for the XLL+ event model.

Example

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.

CopyC++
// Define a class derived from CXlCalculateEventStaticObserver 
class CMyCalculateEventObserver : CXlCalculateEventStaticObserver
{
public:
    // This method will be called during the XlCalculate event. 
    virtual void Update(CXlWorksheetEventArgs* e)
    {
        CXllApp::XlMessageBox(_T("Calculating ") + e->GetSheetName(), 
            XlMessageBoxTypeInformation);
    }
};

// Create an instance of the class
CMyCalculateEventObserver myCalculateObserver;

Requirements

Header: xlpevents.h

See Also

CXlCalculateEventStaticObserver Class | CXlCalculateEventStaticObserver Methods