4

I am automating a website to fill login details. I have developed that app in vb6 and that was working greatly in windows xp, 7 and 8. Now it is giving error in Windows 10. In windows 10 when I run the exe directly, the login details are not filling.(I get "OnQuit fired" message). However, when I run the exe as Administrator it works properly. This is the 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 as administrator is required for simple web automation ? Is it not possible to run application in standard user in Windows 10 ? How to solve this problem ?

Please don’t suggest me to rebuild application in .net ( It will take lot of time to convert my application to .net)

IT researcher
  • 3,274
  • 17
  • 79
  • 143
  • 1
    upvoted your question, since windows 8.1 or so, many VB6 based applications require elevation for some reason, would love clarification or documentation on that as well. – Stavm Jul 15 '16 at 07:25
  • Not sure if this applies or not, but it used to work for me when I used WebBrowser control - which is basically IE in a wndow. Under Internet Settings | Security tab, you can click on Custom Level and Enable "Allow scripting of Microsoft Web Browser Control" – dbmitch Jul 18 '16 at 15:06
  • @dbmitch that solution is not working for me. – IT researcher Jul 19 '16 at 04:49
  • Anyone know about Named Permission set of vb6 in Windows 10 ? – IT researcher Jul 21 '16 at 13:16

1 Answers1

0

quick solution to your problem would be to publish a manifest along with your .exe

described here: How do I create a manifest file in Visual Basic 6.0?

Community
  • 1
  • 1
Stavm
  • 7,833
  • 5
  • 44
  • 68