Progress
Language Reference
CREATE Automation Object Statement
Creates (instantiates) an ActiveX Automation object based on a specified Automation Server connection.
SYNTAX
expression1
A character-string expression that evaluates to 1) a unique name of a valid Automation object stored in the system registry or 2) the null string ("").
COM-hdl-var
A COM-HANDLE variable that receives the COM handle to the instantiated Automation object.
[CONNECT [ TO expression2 ] ]
Specifies the connection option, together with expression1. The behavior of each connection option depends on the execution status of the Automation Server.
Table 16 describes this behavior.
NO-ERROR
Suppresses error messages for the instantiation of an Automation object. You can then test for the ERROR condition to verify that the Automation object is instantiated.
EXAMPLEThe following procedure demonstrates several Automation object instantiations using the four basic connection options. It tries all of the options with the Microsoft Excel Automation Server. Note that not all Automation Servers support all options. For example in Office 95, there is no Automation object for PowerPoint presentations. Thus, the file connection option (Option 3 in Table 16) does not work.
NOTES
- You must ensure that any third-party Automation objects you want to instantiate are installed and correctly listed in the registry. For information on what Automation objects you can instantiate, see the documentation for the third-party product. Generally, these are the same Automation objects instantiated by the Visual Basic CreateObject and GetObject functions. You might also be able to view these Automation objects using the Progress COM Object Viewer tool. For more information, see the Progress External Program Interfaces manual.
- The instantiation of an Automation object depends on the implementation of the Automation Server itself. Any Server registered for multiple use (REGCLS_MULTIPLE_USE flag) launches a single instance of the Server that handles multiple Automation object instantiation requests. Any Server registered single use (REGCLS_SINGLE_USE flag) launches a new instance of the Server for each instantiated Automation object.
- The four connection options in Table 16 compare to the following Visual Basic function calls:
- Once you create or connect to an Automation object, you can reference its properties and methods.
SEE ALSO
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |