Bookshelf Home | Contents | Index | PDF |
Siebel VB Language Reference > VB Language Reference > GetObject FunctionThis standard VB function returns a COM object associated with the file name or the application name. Syntax ASyntax BSyntax CReturnsThe object associated with pathname or the object associated with class. UsageUse GetObject with the Set statement to assign a variable to the object for use in a Basic procedure. The variable used must first be dimensioned as an object. Syntax A of GetObject accesses a COM object stored in a file. For example, the following two lines dimension a variable as an object and assign the object
If the application supports accessing component objects within the file, you can append an exclamation point and a component object name to the file name, as follows:
Syntax B of GetObject accesses a COM object of a particular class that is stored in a file. Class uses the syntax appName.objectType, where appName is the name of the application that provides the object, and objectType is the type or class of the object. For example:
The third form of GetObject accesses the active COM object of a particular class. For example:
If you use the third form of GetObject with a null string ("") as the pathname, a new object instance of the specified type is returned. Thus, the preceding example gets an open instance of the Siebel application, while
instantiates the Siebel application in memory, independent of the user interface. NOTE: The last two examples refer to the object SiebelAppServer, which has been defined as an object type as configured in your external Visual Basic environment. ExampleThis example opens a specific Excel worksheet and places the contents of the Name field of the active business component in it. The worksheet file must already exist. Sub Button1_Click 'Make Excel visible through the Application object. 'Place some text in the first cell of the sheet. 'Save the sheet. See AlsoCreateObject Function |
Siebel VB Language Reference |