This is machine translation

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

Explore COM Objects

A COM object has properties, methods, events, and interfaces. Your vendor documentation describes these features, but you can also learn about your object using MATLAB® commands.

Exploring Properties

A property is information that is associated with a COM object. To see a list of properties of an object, use the COM get function. Alternatively, use the MATLAB Property Inspector, a user interface to display and modify properties. For example, to list all properties of a Microsoft® Excel® object type:

myApp = actxserver('Excel.Application');

MATLAB displays the properties for your Excel version. To display a single property, type:

ans =

MathWorks, Inc.

MATLAB displays the value for your application.

To open the Property Inspector, choose one of the following.

  • Call the inspect function from the MATLAB command line:

  • Double-click the myApp object in the MATLAB Workspace browser.

MATLAB opens the Inspector window. Scroll down until you see the OrganizationName property, the same value returned by the get function.

Exploring Methods

A method is a procedure you call to perform a specific action on the COM object. For example, to list all methods supported by the Excel object, type:

myApp = actxserver('Excel.Application');

MATLAB opens a window showing the method signatures for COM.Excel_Application objects.

Exploring Events

An event is typically a user-initiated action that takes place in a server application, which often requires a reaction from the client. For example, clicking the mouse at a particular location in a server interface window might require the client to respond. When an event is fired, the server communicates this occurrence to the client. If the client is listening for this particular type of event, it responds by executing a routine called an event handler.

Use the events function to list all events known to the control or server and use the eventlisteners function to list registered events.

For example, to list the events for the Microsoft Internet Explorer® web browser, type:

myNet = actxserver('internetexplorer.application');

MATLAB displays the events for your Internet Explorer version. To see which events have event handlers, type:

ans = 

An empty result means that no events are registered.

Exploring Interfaces

An interface is a set of related functions used to access the data of a COM object. When you create a COM object using the actxserver or actxcontrol function, MATLAB returns a handle to an interface. Use the get and interfaces functions to see other interfaces implemented by your object.

For example, to see interfaces of an Excel object, type:

e = actxserver('Excel.Application');

MATLAB displays the properties, including interfaces, for your Excel version. For example, Workbooks is an interface.

ans =

To explore the Workbooks interface, create a workbooks object and use the relevant MATLAB commands.

w = e.Workbooks;

Identifying Objects and Interfaces



Return the class of an object.


Determine if an object is of a given MATLAB class.


Determine if the input is a COM or ActiveX® object.


Determine if an item is an event of a COM object.


Determine if an item is a method of a COM object.


Determine if an item is a property of a COM object.


Determine if the input is a COM interface.

See Also

| | | | |

More About

External Websites

Was this topic helpful?