0

I'm trying to export a file from website but for that i have to select the elements i want to export from a checkbox.

The HTML code for the checkbox i want to tick is:

<input id="MainReport_ctl04_ctl09_divDropDown_ctl00" type="checkbox" name="MainReport$ctl04$ctl09$divDropDown$ctl00" onclick="$get('MainReport_ctl04_ctl09').control.OnSelectAllClick(this);" class="">

I've tried:

With IE.document.getElementsByName("MainReport$ctl04$ctl09$divDropDown$ctl00")
.Item.Click
end with

And

With IE.document.getElementsByName("MainReport$ctl04$ctl09$divDropDown$ctl00")
.Item(0).Checked = True 
End With

And

Set obj = IE.document.getElementsByName("MainReport$ctl04$ctl09$divDropDown$ctl00")
obj.FireEvent ("onclick")

But nothing seems to work.

Could someone help me please? Thank u in advanced!

4
  • Possible duplicate of VBA - Checking Checkbox in IE Commented Aug 1, 2018 at 15:48
  • Try IE.document.parentWindow.execScript("$get('MainReport_ctl04_ctl09').control.OnSelectAllClick(this);"). Commented Aug 1, 2018 at 15:52
  • @omegastripes thank u for ur answer. i tried, but it didn't tick the checkbox... Commented Aug 1, 2018 at 15:57
  • Could you please provide actual URL and expected file format and contents? That might be XY problem. Commented Aug 1, 2018 at 18:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.