Results 1 to 2 of 2
  1. #1
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480

    Trying to automate a webpage that uses iframes. oie.document.frames(0).document.all.Oy!

    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.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    I don't do much with html/vba and know little (nothing) about iframes.
    But here is a link that you may understand/work with.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-23-2014, 09:36 AM
  2. document database
    By Mbakker71 in forum Database Design
    Replies: 8
    Last Post: 12-27-2013, 02:14 PM
  3. save document
    By scamper in forum Reports
    Replies: 1
    Last Post: 01-03-2012, 11:33 AM
  4. wor document disappears
    By hornet385 in forum Access
    Replies: 1
    Last Post: 07-14-2010, 01:30 PM
  5. Document Database
    By Wrangler in forum Access
    Replies: 2
    Last Post: 01-22-2010, 11:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums