1

As long as I've seen the vollowing code should work:

Sub iFrameInnerHTML()
    Const cURL = "https://invest.ameritrade.com/grid/p/login?logout=L&promo=3"
    Set IE = New InternetExplorer
    IE.Visible = True
    IE.Navigate cURL

    Do While IE.READYSTATE <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop

    Dim iFrm As HTMLIFrame
    Set iFrm = IE.Document.frames(1).Document.getElementById("noscript-frame")
    Debug.Print iFrm.Document.body.innerText
End Sub

But I obain an error in "set iFrm = ...." line.

Any help would be appreciated. Alvaro de Leon

7
  • You should make sure the framed document has completed loading: your code only checks the status of the parent page. Feb 15, 2014 at 22:29
  • error '-2147562319)' at execution time. Error in method 'frames' object 'JScriptTypeInfo' Feb 16, 2014 at 23:20
  • You're right, formally the program is not making sure that the framed doc has loaded completely. Anyway, (1) the error seems to be a syntax error, that I don`t understand and (2) in debugging mode, I waited long enough to be sure that the frame is loaded; got the same error. Feb 16, 2014 at 23:27
  • This Sub is very simple and should work, just copied and pasted as an Excel macro. Perhaps somebody can reproduce this behaviour and find out what is happening. Thank you. Feb 16, 2014 at 23:29
  • 1
    @student - if you need help you should ask a question (with more details, and code) Sep 30, 2014 at 14:55

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.