HTML Object Libray: Essentially Creating a Script to Pull Personal Finances From Online Bank Account

pawest

Board Regular
Joined
Jun 27, 2011
Messages
105
Hello VBA and HTML Object Library coders,
I have a cool personal project (at least I think it's cool). I am really into tracking my personal finances and I am using GnuCash to manage all my money and bank accounts as if it were a real business. If interested, GnuCash is free and available at Free Accounting Software | GnuCash ... there is a ton of support behind this gnu project and I've learned more from reading their accounting manuals than I did in my college courses!

Anyways, back to the project. I'm essentially trying to create a script via VBA (don't know any scripting languages) to pull my .QIF banking transaction history every week and I'll manually assign it to the general ledger. With the code that I currently wrote, I'm able to login to my 5/3 account, navigate to the export history window, but I get stuck at trying to choose the right account and enter the dates.

Here are three sites I'm using as references for my code:
VBA Express : Excel - Log In to an Internet Site
Reading web data with VBA from excel using Microsoft HTML Object Library and Microsoft Internet Controls | Menelaos Bakopoulos
InternetExplorer Object

Here's the code I have so far:
Code:
'Make sure Microsoft HTML Object Library and Internet Controls are selected from references

Sub IE_login()
    Dim ie As InternetExplorer
    Dim C
    Dim ULogin As Boolean, ieForm
    Dim myPass As String, myUser As String
    Dim historyDate As Date
     
    myUser = "XX loginusername XX"
    myPass = "XX mypassword XX"
    
    historyDate = Now
    historyDate = Format(historyDate, "mm/dd/yyyy")
    
    'Attempting to open IE and login
    Set ie = New InternetExplorer
    ie.Visible = True
    ie.navigate "https://www.53.com/site"
     
    'Loop until ie page is fully loaded
    Do Until ie.ReadyState = READYSTATE_COMPLETE
    Loop
     
    'Look for password Form by finding test "Password"
    For Each ieForm In ie.Document.Forms
        If InStr(ieForm.innerText, "Password") <> 0 Then
            ULogin = True
             'enter details
            ieForm(0).Value = myUser
            ieForm(1).Value = myPass
             'login
            ieForm.submit
            Exit For
        Else
        End If
    Next
    

    'Wait 7 seconds for good pracitce
    Application.Wait DateAdd("s", 7, Now)
    
    'Loop until online banking page is fully loaded
    Do Until ie.ReadyState = READYSTATE_COMPLETE
    Loop
    
    'Attempt to navigate to Export files site
    ie.navigate "https://www.53.com/servlet/efsonline/accounts-export.html"
      
    'Wait 7 seconds for good pracitce
    Application.Wait DateAdd("s", 7, Now)
    
    'Loop until online banking page is fully loaded
    Do Until ie.ReadyState = READYSTATE_COMPLETE
    Loop
    
    ' *************************************************
    ' *************************************************
    ' *****    The rest of the code is where     ******
    ' *****       I beging to have issues        ******
    ' *****    I don't know what to do with      ******
    ' *****      the textfields and dates        ******
    ' *************************************************
    ' *************************************************

    'Look for history From by finding test "Account"
   For Each ieForm In ie.Document.Forms
        If InStr(ieForm.innerText, "Account") <> 0 Then
            
            For Each ieForm.Selectedlist In ieForm
             
                ULogin = True
           
                If ieForm(0).Value = _
                "XX checking account XX" Or _
                "XX savings account XX" Then

                    ieForm(1).Value = historyDate - Day(7)
                    ieForm(2).Value = historyDate
            
                ieForm.submit
                
                    ' then I would have more code here to process a file download
            
                End If
            
            Next ieForm.Selectedlist
    
        End If
    Next  
End Sub

To see what the export history online account interface looks like, go to a google image search and search for "ib‑sc‑internet‑banking‑1.jpg" ... I'll try to insert the picture here:


I was having issues pasting the source code from the website. I can post this later if that would be helpful to figuring out this project (which it seems like it would be). Thanks for your consideration to help!
 
Norie, you're right... I'm not finding that as a feasbile solution as links change.

Also, to make things tougher. 5/3 just updated their export history options to become a pop up window like this:

NewExportHistory.jpg


Is there any way I can deal with popup window's like this? will it be another form to deal with?

Also, I have to use the Windows API it sounds like to use the "Save As" button. Do you have any further suggestions?

Thanks.
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top