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

    Interacting with iframes and forms in VBA, using internet exploder reference library

    So I have been working on a project for quite some time. I have recently ran into a roadblock that is driving me mad. I am trying to interact with some elements on a webpage, normally this is easily accomplished...However this webpage is really giving me a hard time.



    This is the element that I am trying to interact with.
    Code:
    <input name="instance/number" tabIndex="-1" class="FormatInputReadonly" id="X4" style="width: 100%; height: 100%;" onclick="handleOnClick(this, event);" onfocus="handleOnFocus(this, event);" onblur="
        applyToSameControl(this);
      " onchange="handleOnChange(this, event);" type="text" maxLength="2147483647" readOnly="readonly" ButtonId="" dvdVar="" scripttype="text" scType="Text" dataType="string" value="IM3322958"/>
    So, the item has an ID, it has an input name, should be obtainable... however, the html that this element is in is a MESS... I count 2 iframes, and 1 form that everything is under, and I can not hook in the right way. I am hoping there is someone out there who can help.. I have a pressing deadline and my yearly review is coming up... Freaking out does not even begin to state how much pressure this is lol

    I have linked to the image of the HTML http://i.imgur.com/kvUETTu.jpg
    ANY help is more then appreciated...

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I have been crazy busy lately. When I have a chance, I will take a look at this. My approach to frames is to iterate nodes with a select case statement. The select case statement instantiates the object as the appropriate class and then moves to the next.

    If the HTML is not dynamic, you could possibly enumerate the nodes and then hard code the results, eliminating the select case.

  3. #3
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    That would be amazing, your approach seems much more productive then mine.. I generally end up screaming at the top of my lungs for a few days.

    If there is anything else you need please let me know, I'm even open to skype and a webex to show you my attempts and code in production.

    The HTML is somewhat dynamic, they do change things on a regular basis.

  4. #4
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    I am getting to the point where I would be willing to pay someone to help me figure this out.

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I was going to PM you some code examples but it would probably be better if I created some code based on the HTML. Can you post or PM me the HTML so I can create an HTML file locally?

  6. #6
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    its a ticketing system local to my company, I am not sure that it can be accessed from outside the company. Some examples should be enough to get me started. I have been stuck on this for so many days now

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    So you are trying to get to the input element "instance/number" within the element id "X4Edit"?

    Are you able to retrieve outer HTML for iFrame "ext-Gen603"?

  8. #8
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    I havn't tried using the outerhtml, now you have my interest. I have been getting close with this, but for some reason my elements don't display.. take a look

    Code:
    Sub Tester()Dim oie As InternetExplorer
    Dim oCell As Object
    Dim Cnt As Variant
    Dim resultClasses, resultClass, resultClasses1, resultClass1
    On Error Resume Next
    
    
    Set oie = FindIE("intranet site")
        
    
    
        Set resultClasses = oie.Document.getElementsBytagname("iframe")
        Debug.Print "start"
        For Each resultClass In resultClasses
        '    Debug.Print resultClass.Name
            Set resultClasses1 = resultClass.Document.getElementsBytagname("input")
            For Each resultClass1 In resultClasses1
          '     Debug.Print resultClass.Name
               Debug.Print resultClass.Name & " | " & resultClass1.Name
            Next resultClass1
        Next resultClass
        Debug.Print "done"
    End Sub
    now obviously this won't click on anything or capture anything.. but it is a way for me to try to FIND what I am looking for thru code.. and, everything I have tried has failed misserably, can you post an example with the outerhtml being used? An example should do, doesn't need to be custom fit for my crisis lol.

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    The problem is probably in the .Name. Not all elements have a name. Some use "Hidden" and some even use alias' for the tag itself. I sent you a PM. That will get you started and then I will show you more code. I don't want to post it publicly because it could possibly be used by mean people.

  10. #10
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Yea, I have tried so many things at this point .id .name .value .innertext .innerhtml etc etc etc I just can't get my code into the proper place.

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

Similar Threads

  1. Runtime Access & Outlook library reference
    By Ruegen in forum Access
    Replies: 16
    Last Post: 12-10-2013, 05:26 PM
  2. Replies: 0
    Last Post: 01-25-2013, 09:33 AM
  3. Replies: 2
    Last Post: 11-21-2012, 09:57 AM
  4. MU File Reference Library
    By dandoescode in forum Access
    Replies: 17
    Last Post: 06-20-2012, 12:40 PM
  5. Report that Pulls from two Forms - Lending Library
    By Surferboy1500 in forum Access
    Replies: 8
    Last Post: 06-07-2011, 12:13 PM

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