Excel VBA更改表单中的下拉菜单

我尝试了一些替代scheme,但没有成功,改变combobox,你可以find下面的网站代码(它看起来问题是,combobox是在一个窗体 – 我不能改变一个input框):

<form action="procRelLmPorData.asp" method="post" target="ifrmGerar" id="frmGerar" name="frmGerar"> <input type="hidden" name="ordem" id="ordem" value="" /> <table style="width:100%;" cellpadding="0" cellspacing="0"> <tr> <th class="header">Licenças Médicas por Data</th> </tr> </table> <table style="border-bottom:#048282 thin solid;width:100%;"> <tr> <td style="width:20%;vertical-align:top;"> <table> <tr> <td>Regional: </td> <td> <select style="width:200px" name="regional" id="regional" onchange="comboFilial(this.value);comboSetor('');"> <option value="">Selecione</option> <option value='67'>RJ</option> </select> 

我已经尝试了下面的代码来解决它:

假设objie = InternetExplorer.Application

1st – objie.Document.forms("frmGerar").getElementsByTagName("select")("regional").Value = 67

2nd – objie.Document.forms("frmGerar").Item("regional").Value = 67

3rd – objie.Document.getElementById("regional").selectedindex= 2

你能认为是什么问题?

编辑


我发现窗体是在IFrame里面,你可以find下面的代码:

 <iframe name="ifrmCentro" id="ifrmCentro" src="mapPath.asp?codMenu=404" frameborder="0" style="border: 0px currentColor; border-image: none; width: 100%; height: 177px; display: block;"></iframe> 

我做到了。

问题是我必须浏览的iFrame。

 .Navigate Website & "mapPath.asp?codMenu=404" Do While .Busy Or .ReadyState <> 4 DoEvents Loop 

之后,我可以填写框并selectcombobox:

 .Document.all("datInicial").Value = Range("A6").Text .Document.all("datFinal").Value = Range("A7").Text .Document.all("regional").Value = 67 

谢谢!