dimanche 7 juin 2020

Clicking checkbox for website with only div class available

HTML Code

<div class="_2yjv">
<input type="checkbox">

VBA Code

'Click check box
Dim cbox As Object
    Set cbox = ie.document.getElementsByClassName("_2yjv")(0)
    cbox.Click

Hi, I have been trying to put a check on a checkbox for a couple of hours now and have tried the following:

  • cbox.Click
  • cbox.DoubleClick
  • cbox.Value = True
  • cbox.Checked = True
  • cbox.Value = 1

cbox.Click and cbox.DoubleClick had no errors, but is not doing anything. The rest shows errors. It's the only checkbox from a popup window.

I've been searching this forum and others but they usually have the name value on them, and I can only find those two lines from inspect element which points to the checkbox button. Would really appreciate any help on this. I'm new and still learning VBA. Thank you.




Aucun commentaire:

Enregistrer un commentaire