Is operator

Compares two object reference variables to determine if they refer to the same object.

result = object1 Is object2

Item Description
result Any variable
object Any object variable

If both objects refer to the same object, the result is true. If they do not refer to the same object, the result is false.

You can compare an object to the Nothing keyword, which represents an uninitialized dynamic COM object.

In the following example, the If statement evaluates the IE variable value. If the variable value is not set, the result is true, and the CreateObject statement creates the InternetExplorer object, which is assigned as the IE variable value. If the variable value is set, the result is false, the CreateObject statement does not run, and the script continues with the steps outside of the If statement block.

If IE Is Nothing Then

IE = CreateObject("InternetExplorer.Application")

End If