INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

HANDLE


PASSWORD
Remember Me
Forgot Password?

Come Join Us!

  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

E-mail*
Handle

Password
Verify P'word
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Member Feedback

"...I wish I knew about this site years ago. It would have saved me a lot of heartaches..."

Geography

Where in the world do Tek-Tips members come from?
dick606 (TechnicalUser)
19 Apr 09 11:08
here is a snippet of my code:

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 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:

CODE

ie.document.forms(me.formnumber).item("username") = me.username
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.

CODE

(e.g. - website textbox = one of my variables)
Anyone have any ideas on this?
Find A Job or Post a Job Opening Click Here.
CautionMP (Programmer)
20 Apr 09 8:23
dick606,
 You need to check the readyState of IE in addition to busy to determine if a page is completely loaded.

Hope this helps,
CMP

For the best results do what I'm thinking, not what I'm saying.
(GMT-07:00) Mountain Time (US & Canada)

dick606 (TechnicalUser)
20 Apr 09 11:44
I'll experiment with it.  thank you.  that may be causing the problems as well?  I had no idea..
newguy86 (TechnicalUser)
22 Apr 09 13:07
You may also want to include an error handler that will loop back and attempt the logon again (personally, I would have it cycle thru about 5 attempts).

Travis
www.enterprise.com

Start A New Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Promoting, selling, recruiting and student posting
are not allowed in the forums.
Posting Policies

LINK TO THIS FORUM!
(Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum)
TITLE: Microsoft: Access Modules (VBA Coding) Forum at Tek-Tips
URL: http://www.tek-tips.com/threadminder.cfm?pid=705
DESCRIPTION: Microsoft: Access Modules (VBA Coding) technical support forum and mutual help system for computer professionals. Selling and recruiting forbidden.