XLL+ Class Library (7.0)

CXlAfterCalculateEventStaticObserver::Update

Respond to an event

virtual void Update(
   CXlAfterCalculateEventArgs* 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.

Availability

Note that this event is only available when running under Excel 2010 (Excel 14) or above.

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 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;

Requirements

Header: xlpevents.h

See Also

CXlAfterCalculateEventStaticObserver Class | CXlAfterCalculateEventStaticObserver Methods