Is there an example on how to use REGISTEREVENT and event handlers with ActiveX/COM objects in MATLAB?

7 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 Feb 2017
Here is a simple example that requires Microsoft Excel. Running EXCELTEST.M will open and show an instance of Excel. You then have 20 seconds to create a new document in Excel. The COM server will be released after 20 seconds. Creating a new document within 20 seconds will trigger the event, which in turn calls the included handler function NEWWORKBOOK_HANDLER.M. The handler function displays status messages in the MATLAB command window.
More information about event handlers can be found in the documentation:

More Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!