Assigns an object reference to a variable or property, or associates a procedure reference with an event.
Set objectvar = {objectexpression | New classname | Nothing} ' or Set object.eventname = GetRef(procname) |
Parameters
- objectvar
-
Required. Name of the variable or property; follows standard variable naming conventions.
- objectexpression
-
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.
- New
-
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.
- classname
-
Optional. Name of the class being created. A class and its members are defined using the Class statement.
- Nothing
-
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.
- object
-
Required. Name of the object with which event is associated.
- event
-
Required. Name of the event to which the function is to be bound.
- procname
-
Required. String containing the name of the Sub or Function being associated with the event.