AddHandler ie.DocumentCompleted gives DocumentCompleted' is not an event of 'Object'
if I put ie.DocumentComplete I get
Value of type 'WebBrowserDocumentCompletedEventHandler' cannot be converted to 'DWebBrowserEvents2_DocumentCompleteEventHandler'
I followed several examples from the web and keep getting these errors. As if its not a code problem but that I'm missing a reference.
Public Class Form1
Dim myHTMLDoc As HtmlDocument
Dim myhtmlelement As HtmlElementCollection
Dim ie As WebBrowser
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ieurl As String
ieurl = "http://companyurl.com"
AddHandler ie.DocumentComplete, AddressOf DocumentCompleteIE
ie.Navigate(ieurl)
ie.Visible = True
End Sub
Private Sub DocumentCompleteIE(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs)
MessageBox.Show("completed - " & ie.LocationURL)
ie.Document.GetElementById("Login").SetAttribute("value", "x123456")
ie.Document.GetElementById("Pwd").SetAttribute("value", "123456")
ie.Document.GetElementById("Btn").InvokeMember("click")
End Sub
End Class
If I start typing ie.Do (after addhandler) I see DocumentComplete as choice and not DocumentCompleted, which I find odd as the code I see everywhere on the net uses DocumentCompleted!
