External Interfaces/API    

Identifying Objects

Use these MATLAB functions to get information about a COM object.

Function
Description
class
Return the class of a COM object
isa
Detect a COM object of a given class
isevent
Determine if an item is an event of a COM object
ismethod
Determine if an item is a method of a COM object
isprop
Determine if an item is a property of a COM object

Create a COM object, h, in an Automation server running Excel, and also a Workbooks interface, w, to the object:

To find out the class of variable w, use the class function:

To test a variable against a known class name, use isa:

To see if UsableWidth is a property of object h, use isprop:

To see if SaveWorkspace is a method of object h, use ismethod. Method names are case sensitive and cannot be abbreviated:

Create the sample mwsamp control that comes with MATLAB, and use isevent to see if DblClick is one of the events that this control recognizes:


  COM Control Events Saving Your Work