Progress
External Program
Interfaces


Option 4: Connect To Or Instantiate Implied Automation Object and File

This option creates a connection to a new or existing instance of the Automation object implicitly defined by the specified file. This option identifies the Automation object and its Server from the specified filename extension, as defined in the registry. If the file is not already open in the Automation Object, it will be opened. In this example, the .xls extension indicates that the object instance is a Sheet object provided by the Excel Automation Server:

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

Figure 8–4 summarizes the basic logic for this option (ignoring the listed error conditions):

Figure 8–4: Automation Connection Option 4

NOTE: This option is equivalent to the Visual Basic GetObject(pathname) function call.


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