It'd help to know what line of code is raising the error.

The only code that I can think of that would cause it is the code that is commented out, but you said you still got the error with it commented.

Unless the error isn't happening in Form_Load().

The only other line that uses an object is the last one: WebBrowser1.Navigate which I highly doubt is causing an error. WebBrowser1 is the web browser control shown in the screen shot, right?

Sorry, only thing I can think of is the error is being caused by something outside of Form_Load().