CreateObject

concerns

The CreateObject function creates a server-side COM object and returns a reference.

For the type-secure use of CreateObject, it is essential to assign the return value of the function to a typed COM object reference.

 

Syntax

CreateObject(Class [, ServerName])

Return value

Type

Description

Variant

The reference to the created COM object.

Parameter

Use

Name

Type

Passing

Description

Required

Class

String

ByVal

The ProgID of the COM class of the object to create.

Optional

ServerName

String

ByVal

Name of the computer, where the object is to be created.

Note

For the use of the optional ServerName parameter, the DLL that provides a class must be registered in the component services of the computer.