0

I need to automate the check (Selecting) a checkbox in the IE webpage through vbscript. I wrote some code for it, but it gives "Object Required" Error for document.getElementById("checkBox(IsAdmin)"), Code Start:

Set oIE = CreateObject("InternetExplorer.application")
With oIE
    .Visible = True
    .navigate ("link")
      wscript.sleep 500
End With
Set oShell = CreateObject("WScript.Shell")
Dim document
document.getElementById("checkBox(IsAdmin)")
Item(0).Checked = True

The HTML source code is like :

Could anyone help me on this?

1
  • To post HTML, add an empty line before it and begin every line with four spaces. (I couldn't edit your post. It says I have to add more text - I don't want to add text.) Commented May 9, 2013 at 12:48

1 Answer 1

2

Be sure your checkBox ID is correct. Also Document is a IE object member.

oIE.Document.getElementById("IsAdmin").Checked = True
Sign up to request clarification or add additional context in comments.

Comments

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.