CreateObject

<< Click to Display Table of Contents >>

Navigation:  COM functions >

CreateObject

Description

Creates and returns a reference to an Automation object.

Syntax

CreateObject(servername.typename)

 

Parameters

Part

Type

Description

servername

String

Required. The name of the application providing the object.

typename

String

Required. The type or class of the object to create.

Remarks

Automation servers provide at least one type of object. For example, a word-processing application may provide an application object, a document object, and a toolbar object.

To create an Automation object, assign the object returned by CreateObject to an object variable:

 

Set ExcelSheet = CreateObject("Excel.Sheet")