SetSharedObject method

Applies to

Description

Sets a shared object variable to a handle to an OLE object. Shared objects retain their values across event boundaries. This is useful if you need to access the same object from two or more event handlers.

Normally you use this method in the event handler from the AppStart event where you create the remote OLE object, and then save it using SetSharedObject. This is so that subsequent event handlers can access the same instance of the object without having to create the object each time it is required. The objects’ reference count is incremented by one.

Syntax

Object.SetSharedObject (ObjectName, SharedObject)

Part

Data type

Description

Object

Object

An object expression that evaluates to an object in the Applies To list.

ObjectName

String

 

SharedObject

Object

 

Settings

Return value

None.

Remarks

Classic method

SetSharedObject