Error in webautomation using vb6 on Windows 10

I can automate the website to fill in the registration data. I developed this application in vb6 and it worked hard in Windows XP, 7 and 8. Now it gives an error in Windows 10. In Windows 10, when I run exe directly, the login information is not filled. (I get the message "OnQuit fired"). However, when I run exe as an administrator, it works correctly. This is vb6 code,

Private Sub Form_Load()

    Set Web = New SHDocVw.InternetExplorer
    Web.Visible = True
    Web.Navigate "https://mytestingsite/login.html ", 8
End Sub
Private Sub Web_DocumentComplete(ByVal pDisp As Object, URL As Variant)
On Error GoTo aaa
    'MsgBox "   URL: " & URL
    If URL = "https://mytestingsite/login.html" Then
    Web.Document.getElementById("Login_userName").Value = "abcd"
    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

My question is: why run an administrator for easy web automation? Can't run the application as a standard user in Windows 10? How to solve this problem?

Please do not suggest me rebuild the application in .net (it will take a long time to convert my application to .net)

+4
2
0

Web = Nothing

0

Source: https://habr.com/ru/post/1647984/


All Articles