Results 1 to 5 of 5

Thread: [RESOLVED] Object Reference not set to an instance of an object

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2013
    Location
    Alexandria VA
    Posts
    10

    Resolved [RESOLVED] Object Reference not set to an instance of an object

    I am getting the error message as the title shows when I try to insert user input into a web page form, please disregard the comment under line 8.

    NOTE: The error will be in line 7 "Dim job As HtmlElement = Me.WebBrowser1.Document.All.Item("JobName")"


    Code:
    Public Class Form1
    
        Private Sub Submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit.Click
            WebBrowser1.Navigate("http:///TEST/")
            With WebBrowser1
                Dim job As HtmlElement = Me.WebBrowser1.Document.All.Item("JobName")
                job.InnerText = TextBox1.Text
                ' .Document.GetElementById("Job").SetAttribute("Value", TextBox1.Text)
            End With
        End Sub
    
        Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
    
        End Sub
    End Class
    Last edited by dougdmusa; Apr 12th, 2013 at 02:51 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width