XLL+ Class Library (7.0)

CXllApp::SetSinkEvents

Sets the SinkEvents flag to switch COM event handling on or off

BOOL SetSinkEvents(
   BOOL bSinkEvents
);

Parameters

bSinkEvents

The new value of the SinkEvents flag

Return Value

Returns the new value of the SinkEvents flag.

Remarks

This function sets the state of the COM event handler.

If it is set to TRUE, then the event handlers for COM events will be invoked whenever significant events occur in Excel.

You can specify event handlers by overloading the appropriate virtual function in your derived application class.

NoteNote:

This method is deprecated.

COM event handlers

The functions registered using CXllApp::SetComEventHandler() will not be called unless SetSinkEvents(TRUE) has been called.

In addition, the following handlers are switched on and off by SetSinkEvents():

CXllApp::OnNewWorkbook()
CXllApp::OnSheetSelectionChange()
CXllApp::OnSheetBeforeDoubleClick()
CXllApp::OnSheetBeforeRightClick()
CXllApp::OnSheetActivate()
CXllApp::OnSheetDeactivate()
CXllApp::OnSheetCalculate()
CXllApp::OnSheetChange()
CXllApp::OnWorkbookOpen()
CXllApp::OnWorkbookActivate()
CXllApp::OnWorkbookDeactivate()
CXllApp::OnWorkbookBeforeClose()
CXllApp::OnWorkbookBeforeSave()
CXllApp::OnWorkbookBeforePrint()
CXllApp::OnWorkbookAddinInstall()
CXllApp::OnWorkbookAddinUninstall()
CXllApp::OnAfterCalculate()
CXllApp::OnWorkbookAfterSave()

Note that the other overridable functions (OnXllOpen() etc) are not affected by the SinkEvents flag.

Requirements

Header: xllplus.h

See Also

CXllApp Class | CXllApp Methods | CXllApp::GetSinkEvents()