when I try to execute this code doc = appIE.document it is throwing error like comexception was unhandled...plz help me..
How to handle it
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim appIE As Object 'InternetExplorer
appIE = Nothing
Dim doc As HtmlDocument
'Dim appIE As Object = CreateObject("InternetExplorer.Application")
If appIE Is Nothing Then appIE = CreateObject("InternetExplorer.Application")
Dim URL = "https://www.facebook.com/souj.shanigaram/"
'Dim doc As HtmlDocument = appIE.document
With appIE
.Navigate(URL)
.Visible = True
End With
doc = appIE.document
For Each obj In doc.GetElementsByTagName("a")
If obj.innerText = "About" Then
obj.Click()
Exit For
End If
Next
What I have tried:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim appIE As Object 'InternetExplorer
appIE = Nothing
Dim doc As HtmlDocument
'Dim appIE As Object = CreateObject("InternetExplorer.Application")
If appIE Is Nothing Then appIE = CreateObject("InternetExplorer.Application")
Dim URL = "https://www.facebook.com/souj.shanigaram/"
'Dim doc As HtmlDocument = appIE.document
With appIE
.Navigate(URL)
.Visible = True
End With
doc = appIE.document
For Each obj In doc.GetElementsByTagName("a")
If obj.innerText = "About" Then
obj.Click()
Exit For
End If
Next