All Manuals > COM/Automation User Guide and Reference Manual > 2 COM Reference Entries

get-object Function

Summary

Returns an interface pointer for a named object.

Package

com

Signature

get-object name &key riid errorp => interface-ptr

Arguments
name
A string.
riid
An optional refiid giving the name of the COM interface return.
errorp
A boolean. The default value is t.
Values
interface-ptr
A COM interface pointer for riid.
Description

The function get-object finds an existing object named by name in the Running Object Table or activates the object if it is not running.

get-object returns an interface pointer for the object's riid interface. If riid is nil, then i-unknown is used.

If an error occurs, an error of type com-error will be signaled if errorp is non-nil, otherwise nil will be returned.

Examples

If C:\temp\spreadsheet.xls is open in Microsoft Excel 2007, then its WorkBook interface can be obtained using:

(get-object "c:\\Temp\\spreadsheet.xls"
            :riid 'i-dispatch)
See also

create-instance
create-object
get-active-object


COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:38