GetObject() (Function)

A JScript function that returns a reference to an object representing a file belonging to an application on your system.

Availability:

JScript - 3.0
Internet Explorer - 4.0
Property/method value type:Automation object
JavaScript syntax:IEGetObject(aLocation)
IEGetObject(aLocation, anObjectType)
IEGetObject(aLocation!aSubObject)
IEGetObject(aLocation!aSubObject, anObjectType)
Argument list:anObjectTypeWhat sort of application and object class type to be created
aLocationA path to the file for the object to be instantiated
aSubObjectA fragment identifier for a sub-object within the file

When this function is called, the application may be activated to provide a remote interface to the file. You can also specify fragments within the file.

The path argument points at the file within the file system where the object you want reposes.

This is related to the ActiveXObject() constructor which creates an object that points at an application or document without loading a file to instantiate it.

The objects created by this function are called Automation objects.

The location value can have a fragment identifier delimited by an exclamation mark. With this for example, you can refer to one worksheet within an excel document.

Example code:

   // Locate an Excel spreadsheet

   myWorkbook = GetObject("F:\\DOCUMENTS\\ACCOUNTS.XLS");

   // Locate one worksheet within an Excel spreadsheet

   myWorkSheet = GetObject("F:\\DOCUMENTS\\ACCOUNTS.XLS!sheet4");

See also:ActiveXObject()