Microsoft Excel - Unable to access Forms which are inside frames of HTML using VBA

Asked By Rajender Prasad on 07-Jun-13 09:56 AM
Set resultClasses = IeUsps.document.getElementsByTagName("FRAME")
   
For Each resultClass In resultClasses
    MsgBox resultClass
.Name
   
Set resultClasses1 = IeUsps.document.getElementsByTagName("form")    
  
For Each resultClass1 In resultClasses1  
      MsgBox resultClass1
.Name   
   
Next resultClass1   
Next resultClass

I have the above code, When I am running the above, I am able to see all the names of frames, but not forms inside of each frame. I have to access, frame inside that required form, inside that some input tags. Please help.

Robbe Morris replied to Rajender Prasad on 03-Jun-13 09:44 AM
resultClass1.document.getElementById('some element id inside the frame');
Rajender Prasad replied to Robbe Morris on 03-Jun-13 09:49 AM
|Thanks..but where do you want me to keep this..
Robbe Morris replied to Rajender Prasad on 03-Jun-13 09:53 AM
Each frame is its own "document".  So, you have to get a reference to each one and use that to perform hunts for controls within it.  You wouldn't want to search for form tags unless you were going to manipulate that specific element.  You'd want to use the found frame element as the "document" to perform your getElementXYZ methods on.
Rajender Prasad replied to Robbe Morris on 03-Jun-13 09:57 AM
Rajender Prasad replied to Robbe Morris on 03-Jun-13 09:58 AM
I have this source code.. Can u help me in getting reference.. I am going mad from a week days..
Robbe Morris replied to Rajender Prasad on 03-Jun-13 10:01 AM
var frameDocument = document.getElementById('RoomPane');



var pzHarnessID = frameDocument.getElementById('pzHarnessID');



alert(pzHarnessID.value);
Rajender Prasad replied to Robbe Morris on 03-Jun-13 10:56 AM
Morris!!. Can u bit explanatory as you are already aware that I am dumb in VBA.. I always post my q here.

will Var work in VBA ???

Am getting an error like Object doesnot support this property or method.