The information in this article applies to:
SYMPTOMS
Referencing an object that has not been instantiated results in this error:
CAUSE
If you declare an object as in this example:
you have allocated a reference to the object (similar to a pointer in the C programming language), but you have not allocated or instantiated the object itself. Therefore, when the object is referenced in code as in this example:
the error message "Object variable or With block not Set" is generated. RESOLUTION
The following three code examples demonstrate how to declare and use
an object variable (MyForm in this case) correctly:
Code Sample One
Code Sample Two
Code Sample Three
Additional query words: 4.00 vb4win vb4all
Keywords : |
Last Reviewed: June 17, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |