Description:
Used to compare two object reference variables.
Syntax:
result = object1 Is object2
Note:
If object1 and object2 both refer to the same object, then result is true, otherwise result if false. Two variables can be made to refer to the same object in several ways.
Example1:
In the following example, the o1 variable has been set to refer to the same object as the o2 variable:
Select and copy to clipboard
Dim o1, o2
Set o1 = o2
The following example makes the o1 variable and the o2 variable refer to the same object as the o3 variable:
Select and copy to clipboard
Set o1 = o3
Set o2 = o3
Example2:
The example for testing the returned Nothing value:
Select and copy to clipboard
Dim oItem
Set oItem = oData.Item("abc")
If oItem Is Nothing Then
' ... error
End If