VBA: how to test for object equality (whether two variables reference the same object)

I’m guessing that’s telling me to override the ‘=’ operator to test if all the fields of the two objects have the same value.

No, it tells you the objects don’t have a default property which would have been called otherwise, and the returned results compared.

You test reference equality with Is

If myObject Is yourObject Then 

Leave a Comment