Returns an interface pointer for a named object.
com
get-object name &key riid errorp => interface-ptr
| name⇩ |
A string. |
| riid⇩ |
An optional refiid giving the name of the COM interface return. |
| errorp⇩ |
A boolean. The default value is t. |
| interface-ptr |
A COM interface pointer for riid. |
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.
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)
COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:38