Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

System.InvalidOperationException was unhandled

Posted on 2007-04-05
2
711 Views
Last Modified: 2008-02-01
Hi Experts,

I have a piece of code that load up a form: -

frmCreatePurchaseOrder.show()

when I run it I get the following error message: -

System.InvalidOperationException was unhandled
  Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: Object reference not set to an instance of an object."

What does this mean please and how can I find out whats causing it.

Many Thanks
Lee
0
Comment
Question by:ljhodgett
2 Comments
 
LVL 35

Accepted Solution

by:
YZlat earned 500 total points
ID: 18857757
use try...catch blocks:


try

  your code here

catch ex as exception
  MsgBox(ex.Message & " - " & ex.StackTrace)
end try
0
 
LVL 24

Expert Comment

by:Jeff Certain
ID: 18857788
Ummm... more to the point... frmCreatePurchaseOrder is probably set to nothing.

Try:
Dim frm as new frmCreatePurchaseOrder
frm.Show()
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question