Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

puzzled by object reference not set error

$
0
0
I'm getting an "Object reference not set to an instance of an object" error on the innertext line in the following code:

Code:

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        If (WebBrowser1.ReadyState = WebBrowserReadyState.Complete) Then
            MsgBox(ListBox2.Items(ListBox1.SelectedIndex).ToString)
            WebBrowser1.Document.All("TITLE").InnerText = ListBox2.Items(ListBox1.SelectedIndex).ToString

        End If
    End Sub

The msgbox does return a value, so why do I get an error when I want to fill the value within the webbrowser ?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>