0

I need a vbscript which should open a page in IE, enter username and password, then keep on refreshing the page after few seconds. I have no idea of vbscript, but here is what I found after searching, it keeps on refreshing the page. doesnt seem to work, keeps on giving me error, object required. The username and password does have a value, I have just omitted it here. The error just comes up before the username could be entered.

Call Main

Function Main
  Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
  IE.Visible = True
  IE.Navigate "URL"
  Wait IE
  With IE.Document
    .getElementsByName("LoginName")(0).value = ""
    .getElementsByName("Password")(0).value = ""
    .getElementsByTagName("a")(0).click
  End With
End Function

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

Below is the error

enter image description here

whyAto8
  • 1,660
  • 4
  • 30
  • 56

0 Answers0