vlax-get-object
 
 
 

Returns a running instance of an application object

(vlax-get-object prog-id)

Arguments

prog-id

A string that identifies the desired application object. The format of prog-id is:

appname.objecttype

where appname is the name of the application and objecttype is the application object. The objecttype may be followed by a version number.

NoteYou can usually find the prog-id for an application in that application's Help. For example, Microsoft Office applications document this information in the VBA Reference.

Return Values

The application object; otherwise nil, if there is no instance of the specified object currently running.

Examples

Obtain the application object for the Excel program:

_$ (vlax-get-object "Excel.Application")
#<VLA-OBJECT _Application 0017bb5c>