InsertClass

Description

Inserts a new object of the specified OLE class in an OLE control.

Syntax

ole2control.InsertClass ( classname )

Argument

Description

ole2control

The name of the OLE control in which you want to create a new object

classname

A string whose value is the name of the class of the object you want to create

Returns

Integer. Returns 0 if it succeeds and one of the following negative values if an error occurs:

If any argument’s value is null, InsertClass returns null.

Usage

Classnames are stored in the Registration database. Examples of classnames include:

Examples

Example 1

This example inserts an empty Excel spreadsheet into the OLE control, ole_1:

integer result

result = ole_1.InsertClass("excel.sheet")

See also