Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

unregisterallevents

Unregister all event handlers associated with COM object events

Syntax

unregisterallevents(c)

Description

example

unregisterallevents(c) unregisters all events previously registered with COM object c. After calling unregisterallevents, the object no longer responds to any events.

Examples

collapse all

Unregister the event handlers from all Microsoft® Excel® workbooks events.

To run this example, create a workbook and register events.

myApp = actxserver('Excel.Application');
wbs = myApp.Workbooks;
wb = Add(wbs);
registerevent(wb,{'Activate' 'EvtActivateHndlr'; 'Deactivate' 'EvtDeactivateHndlr'})
eventlisteners(wb)
ans =

  2×2 cell array

    'Activate'      'EvtActivateHndlr'  
    'Deactivate'    'EvtDeactivateHndlr'

Unregister the event handlers.

unregisterallevents(wb)
eventlisteners(wb)
ans =

  0×0 empty cell array

Input Arguments

collapse all

COM object, specified as a function handle.

Limitations

  • COM functions are available on Microsoft Windows® systems only.

Introduced before R2006a

Was this topic helpful?