xlpevents.h contains definitions of all the event-related classes that implement the XLL+ unified event model.
The file is automatically included in the project files when the AppWizard creates the XLL+ project.
The table below lists the core classes declared in the header file.
| Class | Description |
|---|---|
| CXlEvent | The base class for events. This class implements the Subject of the observer pattern. |
| CXlEventArgs | The base class for the arguments passed with any event. |
| CXlEventObserver | The template class for event observers. This class implements the Observer of the observer pattern. |
| CXlStaticEventObserver | The base class for event observers that are created statically, and register themselves automatically. |
The table below lists the concrete event classes declared in the header file.
| Class | Description |
|---|---|
| CXllOpenEvent | Occurs when the XLL is opened, after OnXllOpenEx(). |
| CXllCloseEvent | Occurs when the XLL is closed, before OnXllClose(). |
| CXlRegisterFunctionsEvent | Occurs before the XLL's add-in functions are registered. |
| CXlNewWorkbookEvent | Occurs when a new workbook is created. |
| CXlSelectionChangeEvent | Occurs when Excel's active cell selection is changed. |
| CXlBeforeDoubleClickEvent | Occurs when the user double-clicks in a worksheet. |
| CXlBeforeRightClickEvent | Occurs when the user right-clicks in a worksheet. |
| CXlSheetActivateEvent | Occurs when a worksheet is activated. |
| CXlSheetDeactivateEvent | Occurs when a worksheet is deactivated. |
| CXlCalculateEvent | Occurs just after Excel has finished calculating a worksheet. |
| CXlSheetChangeEvent | Occurs when a cell is changed in a worksheet. |
| CXlWorkbookOpenEvent | Occurs when a workbook is opened. |
| CXlWorkbookActivateEvent | Occurs when a workbook is activated. |
| CXlWorkbookDeactivateEvent | Occurs when a workbook is deactivated. |
| CXlWorkbookBeforeCloseEvent | Occurs when a workbook is about to be closed, and allows the event to be cancelled. |
| CXlWorkbookBeforeSaveEvent | Occurs when a workbook is about to be saved, and allows the event to be cancelled. |
| CXlWorkbookNewSheetEvent | Occurs when a new worksheet is added to a workbook. |
| CXlAfterCalculateEvent | Occurs after one or more worksheets have been calculated (only available under Excel 2010/Excel 14 or above). |
| CXlWorkbookAfterSaveEvent | Occurs after a workbook has been saved, and provides the new workbook name if the name has been changed by the user (only available under Excel 2010/Excel 14 or above). |
The table below lists the event argument classes declared in the header file.
| Class | Description |
|---|---|
| CXllOpenArgs | An event argument class allowing the event to be cancelled. |
| CXlWorkbookEventArgs | An event argument class containing only a workbook name. |
| CXlWorksheetEventArgs | An event argument class containing only a complete worksheet name. |
| CXlRangeEventArgs | An event argument class containing a complete worksheet name, and a range address. |
| CXlCancellableRangeEventArgs | An event argument class containing a complete worksheet name, and a range address, which can be used to cancel the event. |
| CXlBeforeCloseEventArgs | An event argument class specifying a workbook about to be closed, which can be used to cancel the event. |
| CXlBeforeSaveEventArgs | An event argument class specifying a workbook about to be saved, which can be used to cancel the event. |
| CXlWorkbookNewSheetEventArgs | An event argument class specifying a workbook and its new sheet. |
| CXlAfterSaveEventArgs | An event argument class specifying a workbook which has been saved, with the saved name of the workbook and a flag indicating whether the save operation succeeded. |
| CXlAfterCalculateEventArgs | An event argument class passed for the AfterCalculate event. It contains no data. |
The table below lists the static observer classes declared in the header file. There is one class for each concrete event.