Everyone,

My code is below I am trying to build an app that would feed stock quotes into a textbox on a webpage, submit that page and retrieve the resulting quote. I am coding based upon a tutorial I received from a member here but I can't seem to get the page manipulated. When ever I run I get a NullReferenceException error at the line highlighted. Hopefully someone can help.

Thanks

VB Code:
  1. Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  2.         WebBrowser.Navigate("http://moneycentral.msn.com/investor/research/welcome.asp")
  3.     End Sub
  4.     Private Function GetCurrentWebDoc() As mshtml.HTMLDocument
  5.         Try
  6.             Return DirectCast(WebBrowser.Document, mshtml.HTMLDocument)
  7.         Catch ex As Exception
  8.             Return Nothing
  9.         End Try
  10.     End Function
  11.     Private Function GetCurrentWebForm() As mshtml.HTMLFormElement
  12.         Try
  13.             If GetCurrentWebDoc.forms.length > 0 Then
  14.                 Return DirectCast(GetCurrentWebDoc.forms.item(0), mshtml.HTMLFormElement)
  15.             Else
  16.                 Return Nothing
  17.             End If
  18.         Catch ex As Exception
  19.             Return Nothing
  20.         End Try
  21.     End Function
  22.    
  23.  
  24.    Private Sub SetTextboxText(ByVal Text As String)
  25.         [COLOR=Red]DirectCast(GetCurrentWebForm.item("Symbol"), mshtml.HTMLInputElement).value = Text[/COLOR]    
  26. End Sub
  27.  
  28.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  29.         SetTextboxText(txtdata.Text)
  30.         ClickSubmitButton()
  31.     End Sub
  32.     Private Sub ClickNormalButton()
  33.         DirectCast(GetCurrentWebForm.item("q", 0), mshtml.HTMLButtonElement).click()
  34.     End Sub
  35.     Private Sub ClickSubmitButton()
  36.         DirectCast(GetCurrentWebForm.item("go", 0), mshtml.HTMLButtonElement).click()
  37.     End Sub