Is there an example on how to use REGISTEREVENT and event handlers with ActiveX/COM objects in MATLAB?
7 views (last 30 days)
Show older comments
I would like to know if there is an example on how to use REGISTEREVENT and event handlers with ActiveX/COM objects.
Accepted Answer
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:
0 Comments
More Answers (0)
See Also
Categories
Find more on Use COM Objects in MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!