vendredi 1 juillet 2016

VBA/IE Check the checkbox with same name and different value

I would like to check the first checkbox, but my code in VBA does not work.

<input type="Checkbox" name="report_filters_product" value="2340">
<input type="Checkbox" name="report_filters_product" value="1338">
<input type="Checkbox" name="report_filters_product" value="2998">
<input type="Checkbox" name="report_filters_product" value="8007">

My code to check the first checkbox is:

Set Element = .document.getElementsByName("report_filters_product").Value = 2340    
Element.Checked = True

But this does not work. What might be going wrong?




Aucun commentaire:

Enregistrer un commentaire