XLL+ Class Library

CXllApp::OnWorkbookNewSheet

Called by the framework when a new sheet is added to a workbook

[C++]
virtual void OnWorkbookNewSheet(
   LPDISPATCH dispWorkbook,
   LPDISPATCH dispWorksheet
);

Parameters

dispWorkbook

Pointer to dispatch interface of type Excel.Workbook.

dispWorksheet

Pointer to dispatch interface of type Excel.Worksheet, the newly added worksheet.

Remarks

This function is called when a new sheet is added to a workbook.

Note that it will only be called if event-sinking is switched on (using CXllApp::SetSinkEvents()).

You can override the method in your application class to react to the event. The default method does nothing.

Implementation note

You should only implement this function if you need access to Excel's COM interfaces. If you just want to call an add-in function, use the much simpler mechanism provided by CXllApp::SetComEventHandler().

Requirements

Header: xllplus.h

See Also

CXllApp Class | CXllApp Methods | CXllApp::OnSheetActivate() | CXllApp::OnSheetDeactivate()