如何使用VBA IE自动化单击div下拉菜单



有下面的div类,单击底部会创建一个下拉菜单。在浏览器中,您可以用鼠标单击它,但可以用VBA实现IE自动化。我试了一下";。点击";方法,但不起作用。我还尝试了FireEvent;onclick"onchange"onmouseover";什么都不管用。尝试查看是否有其他解决方案

<div id="add12" style="width: 47px; height: 23px; white-space: nowrap; 
position: static;" 
controltype="DropDown" param="par">
<input name="ct10115" id="ddl" type="hidden" value="E">
<input class="ffb-input" id="input" style="width: 13px;" maxlength="1" 
autocomplete="off">
<span class="ffb-arrow ui-button ui-widget ui-state-default ui-corner-Allui-button-text-icon-primary" id="teste2" role="button" ariadisabled="false" style="position: 
static;">
<span class="ui-button-icon-primary ui-icon ui-icon-triangle-1-s" 
style="left: 0px; top: 0px; margin-top: 0px; position: static;"></span>
<span class="ui-button-text"></span>
</span>
<div class="ffb" id="example11" style="left: 0px; top: 29px; width: 450px; display: none; z- index: 21; opacity: 0.999;">
<div class="content" style="height: auto; max-height: 200px;" scrolltop="0">
<div class="row" id="A" val="A" std_phase_cd="A" std_nm="A_">
<table>
<tbody>
<tr>
<td style="width: 45px;">A </td>
<td>none A </td>
</tr>
</tbody>
</table>
</div>
<div class="row" id="B" val="B" std__cd="B" std_nm="1">
<table>
<tbody>
<tr>
<td style="width: 45px;">B </td>
<td>none1 </td>
</tr>
</tbody>
</table>
</div>

</div>
<div></div>
</div>
</div>

好吧,我想明白了。所以我在浏览器上使用开发工具,发现了点击、鼠标按下等事件。

然后我使用IE.dipatchEvent来触发点击事件。

最新更新