Assigns an object reference to a variable or property, or associates a procedure reference with an event.

Setobjectvar = {objectexpression | Newclassname | Nothing}
' or
Setobject.eventname = GetRef(procname)



Required. Name of the variable or property; follows standard variable naming conventions.


Optional. Expression consisting of the name of an object, another declared variable of the same object type, or a function or method that returns an object of the same object type.


Keyword used to create a new instance of a class. If objectvar contained a reference to an object, that reference is released when the new one is assigned. The New keyword can only be used to create an instance of a class.


Optional. Name of the class being created. A class and its members are defined using the Class statement.


Optional. Discontinues association of objectvar with any specific object or class. Assigning objectvar to Nothing releases all the system and memory resources associated with the previously referenced object when no other variable refers to it.


Required. Name of the object with which event is associated.


Required. Name of the event to which the function is to be bound.


Required. String containing the name of the Sub or Function being associated with the event.

Expand imageRemarks

Expand imageRequirements

Expand imageSee Also