KarinaE
04-15-2011, 11:21 AM
Hi, my code is supposed to automatically log in to a website. Please notice the http should be without the space obviously, but I cannot post links for some reason.
Dim ie As Object
Dim x As Single
Dim url As String
Set ie =CreateObject("InternetExplorer.Application")
url = "h ttp://careers.bankofamerica.com/director.asp?countryid=1&url=https%3a%2f%2fbacfhrs.taleo.net%2fcareersection%2fapplication.jss%3flan g%3den%26type%3d1%26csNo%3d2%26portal%3d140160497%26reqNo%3d878285%26postda ta%3d%24QEbCcxFGN7OUb1h-_JXJTg%3d%3d%26src%3d"
ie.navigate url
ie.visible = True
While ie.busy
DoEvents
Wend x = Timer
While Timer - x < 3
DoEvents
Wend
ie.document.getElementById("dialogTemplate-dialogForm-login-name1").Value = "email"
ie.document.getElementById("dialogTemplate-dialogForm-login-password").Value = "password"
ie.document.forms(0).submit[/vba] This gives a error for [vba]ie.document.getElementById("dialogTemplate-dialogForm-login-name1").Value = "email"
"Object variable or With block variable not"
It has nothing to do with that the page is not fully loaded. Even after waiting 2 min before executing this statement, it gives me this error.
Dim ie As Object
Dim x As Single
Dim url As String
Set ie =CreateObject("InternetExplorer.Application")
url = "h ttp://careers.bankofamerica.com/director.asp?countryid=1&url=https%3a%2f%2fbacfhrs.taleo.net%2fcareersection%2fapplication.jss%3flan g%3den%26type%3d1%26csNo%3d2%26portal%3d140160497%26reqNo%3d878285%26postda ta%3d%24QEbCcxFGN7OUb1h-_JXJTg%3d%3d%26src%3d"
ie.navigate url
ie.visible = True
While ie.busy
DoEvents
Wend x = Timer
While Timer - x < 3
DoEvents
Wend
ie.document.getElementById("dialogTemplate-dialogForm-login-name1").Value = "email"
ie.document.getElementById("dialogTemplate-dialogForm-login-password").Value = "password"
ie.document.forms(0).submit[/vba] This gives a error for [vba]ie.document.getElementById("dialogTemplate-dialogForm-login-name1").Value = "email"
"Object variable or With block variable not"
It has nothing to do with that the page is not fully loaded. Even after waiting 2 min before executing this statement, it gives me this error.