We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,470 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

object variable or with block variable not set

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.

3
Contributors
2
Replies
5 Days
Discussion Span
3 Years Ago
Last Updated
3
Views
vasanth.kanna
Newbie Poster
7 posts since Jan 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Use the "New" Keyword

Dim frm As New TestInterop.InteropForm1
frm.Show

samir_ibrahim
Junior Poster
155 posts since Sep 2008
Reputation Points: 69
Solved Threads: 19
Skill Endorsements: 1

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
CodeDoctor
Light Poster
25 posts since Sep 2009
Reputation Points: 10
Solved Threads: 6
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0777 seconds using 2.68MB