Announcement

Collapse
No announcement yet.

vba web page how to make click on a grid?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • vba web page how to make click on a grid?



    In macro vba excel 2010 with Win7 64bits...I would like to make a click on a grid with virtual keyboard
    Grid compose 16 cases..each case in class tag "case-xw pos-f" , "case-xw pos-e", "case-xw pos-g" In the webpage I use the mouse to click on the case and the number (in grid) is select and compose the password... with this loop vba i use the tag "span" exemple :
    html
    <div classcode :="clavier-virtuel-item">
    <span class="case-xw pos-f" onmouseup="(function(e, o){ if(e.which){var tmp=e.which;if(tmp != 0 &amp;&amp; tmp != 1){return;}} else if(e.button){var tmp=e.button;if(tmp != 0 &amp;&amp; tmp != 1){return;}} clickClavierVirtuel(o); })(event, this)"></span>

    I use this macro :
    Set Helem = MyPageHtml.getElementsByTagName("span")
    For j = 14 To Helem.Length - 1
    Range("A" & (j + 1)).Value = Helem(j).getAttribute("class") & " / " & helem(j).getAttribute("onmouseup")
    If Range("A" & (j + 1)).Value Like "*pos-p" Then Helem(j).Click
    Next j

    I've add this line also :
    MyPageHtml.parentWindow.execScript "'function(e, o)'", "Javascript"

    I've no message error...But the Click don't work...How launch function(e, o) on onmouseup ???
    Thanks to help me!
    Last edited by samaipata; September 5th, 2017, 21:06.
Working...
X