lundi 1 juillet 2019

How to tick 'checkbox' in IE using VBA?

I need to tick a checkbox using vba on a certain website. I have tried several methods, however without any luck so far.

It is impossible to inspect this element (checkbox) by clicking right mouse button on it, because if you click left/right mouse buttons - checkbox becomes checked. In order to identifty the element, I have click CTRL+SHIFT+C and found out responsible piece of code for it.

I have tried to locate this element by: 1) It's class, then tried to use '.click' or '.checked = true' methods, 2) .getAttribute("onmousemove"...) 3) .getAttribute("ontouchstart"...)

However none of those worked. There was no error, however the checkbox was not ticked.

I have found out that when you move your mouse over the checkbox - it's style is being changed to: "height: 19px; cursor: pointer

         <tr ontouchstart="Grids[0].ARow=Grids[0].Rows[&quot;1_1&quot;];Grids[0].ASec=0;"
 onmousemove="Grids[0].ARow=Grids[0].Rows[&quot;1_1&quot;];Grids[0].ASec=0;"
 class="GODataRow  GOClassChanged" style="height: 19px;"></tr>

I expect the checkbox to be checked.




Aucun commentaire:

Enregistrer un commentaire