VBA IE Automation - Read iFrame VBA IE Automation - Read iFrame vba vba

VBA IE Automation - Read iFrame


I faced the same issue and I got the solution using the following line of script..

IE.Document.getElementsbyTagName("iframe")(0).contentDocument.getElementsbyTagName("body")(0).innertext


Try this...

Dim elemCollection As IHTMLElementCollectionSet elemCollection = objDoc.frames("iFrameID").document.allDebug.Print elemCollection.Item("pagemenuli-adv").innerText


I faced a similar problem, finally solved it using:

ObjIE.document.frames(0).document.forms(0).innerText

Note: The text which I was in need was present in form which is located in a iframe.

Am new to VBA, can some body explain what exactly 0 in Frames(0)/forms (0) is?

If it something like Frame index or frame number(As of my assumption) please let me know how can we find frame index(in any HTML)?