如何使用vba在IE中选择单选按钮?

时间:2017-08-29 17:29:19

标签: excel-vba vba excel

我正在尝试选择单选按钮并在selectCls中选择值,但是我的代码遇到问题请帮助我同样的

提前致谢..

我的VBA代码是:

Browser.document.getElementById("ddlCycleID").SelectCls = "Cycle 274 (21 Jun 2017 - 31 Jul 2017)" 
    Browser.document.getElementById("chkproc").Checked = True 
    Browser.document.getElementById("btnSubmit").Click 

HTML源代码是:

<td> 
<input value="chkproc" name="Module" type="radio" id="chkproc" checked="checked" tabindex="1" onclick="toggle(this)"> Processing Module 
<td> 


<td> 
<input value="chkquery" name="Module" type="radio" id="chkquery" tabindex="2" onclick="toggle(this)"> Other Modules 
<td> 


<td> 
<select name="ddlCycleID" id="ddlCycleID" tabindex="4" class="SelectCls" style="width:180px;"> 
<option value="Select Cycle">Select Cycle</option> 
<option value="274">Cycle 274 (21 Jun 2017 - 31 Jul 2017)</option> 
<option value="273">Cycle 273 (29 Jun 2017 - 29 Jun 2017)</option> 


</select> 
<td> 

低于错误消息msg

运行时错误&#39; 424&#39;

需要对象

在此代码中:

Browser.document.getElementById("ddlCycleID").SelectCls = "Cycle 274 (21 Jun 2017 - 31 Jul 2017)"

showing this "=""  when i place cursor on this code

0 个答案:

没有答案