Bookshelf Home | Contents | Index | PDF |
Siebel eScript Language Reference > Siebel eScript Commands > The Global Object > COMCreateObject() MethodCOMCreateObject instantiates a COM object. SyntaxReturnsA COM object if successful; otherwise, undefined. UsageYou should be able to pass any type of variable to the COM object being called; however, you must ascertain that the variable is of a valid type for the COM object. Valid types are strings, numbers, and object pointers. This method can be executed in server script only; it does not apply to browser script. NOTE: DLLs instantiated by this method must be thread-safe. ExampleThis example instantiates Microsoft Excel as a COM object and makes it visible: var ExcelApp = COMCreateObject("Excel.Application"); // Make Excel visible through the Application object. // Place some text in the first cell of the sheet // Save the sheet // Close Excel with the Quit method on the Application object // Clear the object from memory NOTE: Applications, such as Excel, may change from version to version, requiring you to change your code to match. This example code was tested on Excel 2002. |
Siebel eScript Language Reference |