Consulting

Results 1 to 2 of 2

Thread: "Run-Time Error 91" trying to run Login Code

  1. #1

    "Run-Time Error 91" trying to run Login Code

    Hello. I've been trying to scrape together a code that will work to auto login to several secure accounts for home budgeting purposes. I'm trying to use the current one to log into my bank (Chase). I'm getting a Run-Time Error 91 thrown at the following line:

    HTMLDoc.getElementById("userId").Value = "mylogin"

    I continue to get errors at this line. I can't figure out what I'm doing wrong. I hopped on the Chase site, did a right-click on the "login-box" and I think I have the information in there correctly....but I also have no clue what I'm doing so it's possible that I got it wrong. Can someone please look over the below code for me and let me know where I'm going wrong? Thanks for the help.

    Dim HTMLDoc As HTMLDocument
    Dim oBrowser As InternetExplorer
    Sub Chase()
     sURL = "https://www.chase.com/"
     Set oBrowser = New InternetExplorer
     oBrowser.Silent = True
     'oBrowser.timeout = 60
     oBrowser.navigate sURL
     oBrowser.Visible = True
     Do
     ' Wait till the Browser is loaded
     Loop Until oBrowser.readyState = READYSTATE_COMPLETE
     Set HTMLDoc = oBrowser.document
     HTMLDoc.getElementById("userId").Value = "mylogin"
     HTMLDoc.getElementById("password-input-field").Value = "mypassword"
     SendKeys "{Submit}", True
     ' oBrowser.Refresh ' Refresh If Needed
    Err_Clear:
     If Err <> 0 Then
     Err.Clear
     Resume Next
     End If
     End Sub

  2. #2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •