1.11M Members

object variable or with block variable not set

 
0
 

Hello Friends,

When i try to show VB.net interop forms within VB 6.0 i have got the error "object variable or with block variable not set ". I was create interop form library in vb.net and use the created TLB as a referece in VB 6.0 and in button click i write the following code.

Dim frm As TestInterop.InteropForm1
frm.Show

when i run the vb project and click on the button i got the above error.
Can you please provide a solution for this. Please reply me as early as possible.

Regards,
Vasanth.

 
0
 

Use the "New" Keyword

Dim frm As New TestInterop.InteropForm1
frm.Show

 
0
 

Hello Friends,

When i try to show VB.net interop forms within VB 6.0 i have got the error "object variable or with block variable not set ". I was create interop form library in vb.net and use the created TLB as a referece in VB 6.0 and in button click i write the following code.

Dim frm As TestInterop.InteropForm1
frm.Show

when i run the vb project and click on the button i got the above error.
Can you please provide a solution for this. Please reply me as early as possible.

Regards,
Vasanth.

You will need to Instantiate the form before you use it.

Dim frm As [B]New[/B] TestInterop.InteropForm1
frm.Show
You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article