Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 699

Why this VBS doesn't work in IE9 but works in IE8

$
0
0
Hi,
I found this script online, I edited it for my needs and does what I need it to do, but it only works without problem in IE8, if I run on my other PC where IE9 is installed it gives me error.
please help

Code:

WScript.Quit Main

Function Main
  Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
  IE.Visible = True
  IE.Navigate "http://gmail.com"
  Wait IE
  With IE.Document
    .getElementByID("login_username").value = "myuser"
    .getElementByID("login_password").value = "mypass"
    .getElementByID("frmLogin").submit
  End With
End Function

Sub Wait(IE)
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState < 4 And IE.Busy
End Sub

Sub IE_OnQuit
  On Error Resume Next
  WScript.StdErr.WriteLine "IE closed before script finished."
  WScript.Quit
End Sub

error my script giving.
Attachment 95011
Attached Images
 

Viewing all articles
Browse latest Browse all 699


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>