Release 10.1A: OpenEdge Development:
Programming Interfaces

> ## Option 3: connect to or instantiate a named Automation object and file

> This option creates a connection to a new or existing instance of the specified Automation object and opens the specified file. If the file is not already open, it is opened. If the pathname for the specified file is invalid or unrecognizable by the Server, this connection option fails. In this example, the file `\WorkSheets\Xplan.xls` is opened in the new or existing instance of the "Excel.Sheet" object:

>     DEFINE VARIABLE hExcelObject AS COM-HANDLE
>     CREATE "Excel.Sheet" hExcelObject CONNECT TO "\WorkSheets\Xplan.xls".

> Figure 15–3 summarizes the basic logic for this option (ignoring the listed error conditions).

> Figure 15–3: Automation connection option 3

> Note: This option is equivalent to the Visual Basic GetObject(pathname,class) function call.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095