Error in Internet Explorer 11 for website automation using vb6
I am automating the website ("http://incometaxindiaefiling.gov.in/e-Filing/UserLogin/LoginHome.html") filling using vb6. The code which works in IE10 & below,
Code:
Dim WithEvents Web As SHDocVw.InternetExplorer
Private Sub Form_Load()
Set Web = New SHDocVw.InternetExplorer
Web.Visible = True
Web.Navigate "http://incometaxindiaefiling.gov.in/e-Filing/UserLogin/LoginHome.html"
End Sub
Private Sub Web_DocumentComplete(ByVal pDisp As Object, URL As Variant)
On Error GoTo aaa
msgbox " URL: " & URL
if url = "http://incometaxindiaefiling.gov.in/e-Filing/UserLogin/LoginHome.html" then
Web.Document.getElementById("Login_userName").Value = "abcde1111h"
Web.Document.getElementById("Login_userName").onchange
Web.Document.getElementById("Login_password").Value = "123456789"
Web.Document.getElementById("dateField").Value = "15/09/1954"
end if
Exit Sub
aaa:
MsgBox Err.Description & " URL: " & URL
End Sub
Private Sub Web_OnQuit()
MsgBox "OnQuit fired"
End Sub
In IE11 (Windows 10) I am facing the following problem with my code,
when navigated to above URL using SHDocVw.InternetExplorer control
First DocumentComplete event will be fired with URL being empty. Then OnQuit event is fired. Then again DocumentComplete event is fired with URL 'about:blank'
When I run the exe with ‘Run as admin’ option then it works in IE11 without any errors.
Please help.
Re: Error in Internet Explorer 11 for website automation using vb6
Code:
If InStr(URL, "://incometaxindiaefiling.gov.in/e-Filing/UserLogin/LoginHome.html") > 0 Then
Web.Document.getElementById("Login_userName").Value = "abcde1111h"
Web.Document.getElementById("Login_userName").onchange
Web.Document.getElementById("Login_password").Value = "123456789"
Web.Document.getElementById("dateField").Value = "15/09/1954"
End If