Object variable or with block variable not set 
Author Message
 Object variable or with block variable not set

Dear VB,

I have a project that creates an executable with one form (MainForm)
that uses a user control (MainControl.ocx) to do all the work.  "Run
with full Compile" launches the executable.  When I load MainForm in
the designer, the user control is loaded correctly.  I can File | Make
MainControl.ocx with no errors.  However, when I try to make the
executable, I receive the "Object variable or with block variable not
set" error.

The error occurs even if I remove all of the code of MainForm.  This
step used to work.  I have to assume that I made some change to my
project to cause the error.  However, I have no information to guide
me in my search.  How can I debug this problem?

Thanks in advance,

- Ashok Thirumurthi



Sun, 11 Dec 2005 21:51:55 GMT  
 Object variable or with block variable not set

Quote:

> I have a project that creates an executable with one form (MainForm)
> that uses a user control (MainControl.ocx) to do all the work.  "Run
> with full Compile" launches the executable.  When I load MainForm in
> the designer, the user control is loaded correctly.  I can File | Make
> MainControl.ocx with no errors.  However, when I try to make the
> executable, I receive the "Object variable or with block variable not
> set" error.

> The error occurs even if I remove all of the code of MainForm.  This
> step used to work.  I have to assume that I made some change to my
> project to cause the error.  However, I have no information to guide
> me in my search.  How can I debug this problem?

Have you tried adding the project for MainControl.ocx to the same
project group as your executable?


Mon, 12 Dec 2005 00:05:25 GMT  
 Object variable or with block variable not set

Quote:


>> I have a project that creates an executable with one form (MainForm)
>> that uses a user control (MainControl.ocx) to do all the work.  "Run
>> with full Compile" launches the executable.  When I load MainForm in
>> the designer, the user control is loaded correctly.  I can File | Make
>> MainControl.ocx with no errors.  However, when I try to make the
>> executable, I receive the "Object variable or with block variable not
>> set" error.

>> The error occurs even if I remove all of the code of MainForm.  This
>> step used to work.  I have to assume that I made some change to my
>> project to cause the error.  However, I have no information to guide
>> me in my search.  How can I debug this problem?

>Have you tried adding the project for MainControl.ocx to the same
>project group as your executable?

One thing to think about...
If this is a one of a kind OCX, ie: won't be used in other projects you can
add it to the project as code and compile it all together,
NO OCX to play with, distribute, etc..

Food for thought... ;P

Have a good day...

Don



Mon, 12 Dec 2005 00:37:52 GMT  
 Object variable or with block variable not set
Sorry, " project as code " might be a little off handed...
I ment All parts of the UserControl...

Quote:



>>> I have a project that creates an executable with one form (MainForm)
>>> that uses a user control (MainControl.ocx) to do all the work.  "Run
>>> with full Compile" launches the executable.  When I load MainForm in
>>> the designer, the user control is loaded correctly.  I can File | Make
>>> MainControl.ocx with no errors.  However, when I try to make the
>>> executable, I receive the "Object variable or with block variable not
>>> set" error.

>>> The error occurs even if I remove all of the code of MainForm.  This
>>> step used to work.  I have to assume that I made some change to my
>>> project to cause the error.  However, I have no information to guide
>>> me in my search.  How can I debug this problem?

>>Have you tried adding the project for MainControl.ocx to the same
>>project group as your executable?

>One thing to think about...
>If this is a one of a kind OCX, ie: won't be used in other projects you can
>add it to the project as code and compile it all together,
>NO OCX to play with, distribute, etc..

>Food for thought... ;P

>Have a good day...

>Don

Have a good day...

Don



Mon, 12 Dec 2005 00:43:00 GMT  
 Object variable or with block variable not set
Quote:
>Have you tried adding the project for MainControl.ocx to the same

project group as your executable?<

Actually both projects are in the same VBW.  Interestingly enough, I
*occasionally* get the same error when I host the OCX in a different
.Net project.  This is a second fact that points to an error within
the user control.

- Ashok Thirumurthi



Mon, 12 Dec 2005 10:14:20 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Error msg: Object variable or With block variable not set

2. Object variable or With block variable not set when calling COM Dll

3. Object variable or With block variable not set (Error 91)

4. Object variable or With Block variable not set

5. Object variable or With block variable not set

6. ADO recordset: Object variable or with block variable not set

7. Runtime error 91/Object variable or With block variable not set problems

8. Object variable or With block variable not set

9. Object variable or with block variable not set

10. Object variable or With block variable not set error in Class

11. runtime error: 91 Object variable or with block variable not set

12. Object variable or With block variable not set when using simple class example

 

 
Powered by phpBB® Forum Software