VBScript CreateObject Function

Definition and Usage

The CreateObject function can create an object of a specified type.

Syntax

CreateObject(servername.typename[,location])
Parameters Description
servername Required. Provide the name of the application that provides this object.
typename Required. The type or class (type/class) of the object.
location Optional. Where to create the object.

Instance

Example 1

dim myexcel
Set myexcel=CreateObject("Excel.Sheet")
myexcel.Application.Visible=True
...code...
myexcel.Application.Quit
Set myexcel=Nothing