Results 1 to 1 of 1

IE Automation ClassName and ID set focus

Threaded View

  1. #1
    Registered User
    Join Date
    05-30-2014
    Posts
    1

    IE Automation ClassName and ID set focus

    Hey All,

    Currently i am trying to right mouse click onto a specific getElementById/getElementsByClassName. Please find attached the HTML which should show the key elements.
    Manually i would hover over a figure(in this case 88.4(colored in RED)) and then right mouse click which opens a little window where i left click onto Excel Detail Export(colored in GREEN)--> this would than start the downloading process

    This bit unfortuanaly does not work.
    Set xobj = IEapp.Document.getElementsByClassName("content content5")
    Set xobj = xobj.getElementById("kpiId_OB_DOX_2011_NC")
    xobj.Children(3).Click


    Probably the Main issue is that the ClassName("content content5") and the getElementById("kpiId_OB_DOX_2011_NC") is not unique within the entire source code.
    Therefore i tried to loop through all elements but without luck.
    TEST LOOP
    For Each elem In IEapp.Document.all
    If elem.className = "content content5" Then
    Set YTDValue = elem
    Debug.Print YTDValue.innerText
    End If
    Next
    Output
    87.5
    90.1
    88.4 <-- The one i am looking for
    90.3
    79.1
    ...
    ...
    ...

    If you could help me to set the focus onto the object so the xobj.Children(3).Click will work, this would be awesome.
    Thanks in advance.

    Example Source Code.jpg
    Last edited by jan.poppi1984; 09-07-2015 at 05:48 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] vba in website input the textbox using classname
    By sthiru in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 07-16-2015, 03:22 PM
  2. [SOLVED] Worksheet focus problem, how do I set focus?
    By MichiganWilliams in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2014, 03:04 PM
  3. Focus on Last Row
    By tapsmiled in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-04-2014, 05:32 PM
  4. [SOLVED] How to put focus to IE
    By keymuu in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-11-2012, 01:09 AM
  5. Who's got focus
    By Mats Samson in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-20-2011, 04:37 AM
  6. Focus
    By excelquestioner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-19-2007, 12:47 PM
  7. set focus
    By tkaplan in forum Excel General
    Replies: 3
    Last Post: 09-27-2005, 03:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1