I am trying to compile a VB6 application, but it fails with the error, \"Run-time error \'91\': Object variable or With block variable not set\". It turns out the Resize ev
Here's is a good article on the lifecyle of user control events
Understanding Control Lifetime and Key Events
Here is one snippet
Compiling the Project
When the project is compiled into an application or component, Visual Basic loads all the form files invisibly, one after another, in order to write the information they contain into the compiled file. A control instance gets the Initialize, ReadProperties, and WriteProperties events. The control's property settings are compiled into the finished executable.
It doesn't mention resize (which happens during run-time or when you physically resize the usercontrol on a container in design-time). Maybe your Initialize event is resizing the user control?
To avoid the error you can check if the offending object has been created before doing anything:
If Not Object Is Nothing then
do something