I'm trying to create a budget program that will on open open IE and grab an available balance from an account.
I have the login progress completed. But after the webpage loads, it starts to introduce iframes. These iframes are a real pain to navigate, and every attempt I've tried gives me Error '-2147352319'. Anyone have any tips? Or better yet, anyone ever automate the firstcommunity credit union website before lol?
Here is the code...
Code:
Dim oIe As InternetExplorer
Dim User, Pass As String
Dim Loaded As Boolean
Dim Cnt As Variant
Dim oCell As Object
User = Sheet2.Cells(35, 5).Value
Pass = Sheet2.Cells(35, 6).Value
If User = "" Or Pass = "" Then
MsgBox "Credentials are not entered.", vbCritical, "Dumbass"
Sheet2.Cells(35, 6).Select
End If
Set oIe = FindIE("https://www.firstcommunityexpressnet.com/tob/live/usp-core/app/home")
If oIe Is Nothing Then
Set oIe = New InternetExplorer
oIe.Visible = True
oIe.navigate ("https://www.firstcommunity.com/home.html")
'wait for page to load
Call SleepIE(oIe)
PauseApp 3000
'loaded, now login.
oIe.document.all.Item("username").Select
oIe.document.all.Item("username").Value = User
oIe.document.all.Item("password").Select
oIe.document.all.Item("password").Value = Pass
oIe.document.all.Item("oblSubmit").Click
Call SleepIE(oIe)
PauseApp 3000
' oIe.document.all.Item("ext-gen1020").Click
Call SleepIE(oIe)
PauseApp 1000
End If
'Trying to determine if I'm in the correct html container using this loop.
Cnt = 0
With oIe.document.frames("0").document.all ''''''''''Here is where the error occurs.
For Each oCell In .tags("div")
Debug.Print oCell.innerText
Cnt = Cnt + 1
Next oCell
End With
Set oCell = Nothing
'''''
''Things I've tried
'oIe.document.frames("0").document.body 'Same Error
'oIe.document.frames("main").document.all 'Same Error
'oIe.document.frames("main").document.body 'Same Error
'oIe.document.all ' This works, but doesn't navigate into the iframe. So it doesn't contain the data we need.