here is a snippet of my code:
as some may have guessed, i'm trying to automate a login from my database. the problem is, when i click the button on my form to run the ENTIRE code (which is obviously not all here, but it does work), sometimes it is successful and sometimes it is not.
as in, sometimes, i get some of the populations in the textboxes, and sometimes not. when i created a loop to go back through and check for errors in my code, sometimes it bugs at:
with the error of "object variable not set". This cannot be the case, as they are all set in the code. These errors are completely random, as to say that I can run this code 5 times and open up 5 different explorer windows, and the code may be successful the first, last or any other time in between. and I am not sure of the reason why this randomly debugs on ANY of the "populating" lines of code.
Anyone have any ideas on this?
Code:
set ie = createobject("internetexplorer.application")
ie.navigate me.website
while ie.busy
do events
wend
ie.document.forms(me.formnumber).item("username") = me.username
ie.document.forms(me.formnumber).item("password") = me.password
ie.document.forms(me.formnumber).submit
as in, sometimes, i get some of the populations in the textboxes, and sometimes not. when i created a loop to go back through and check for errors in my code, sometimes it bugs at:
Code:
ie.document.forms(me.formnumber).item("username") = me.username
Code:
(e.g. - website textbox = one of my variables)