我的代码:
Const navOpenInNewTab = &H800
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
................
IE.Navigate "https://www./CTMT"
Do While IE.Busy Or IE.ReadyState <> 4: Loop
Application.Wait (Now + TimeValue("00:0:03"))
Set HTMLDoc2 = IE.document
HTMLDoc2.getElementsByName("merchID")(0).Value = "aa"
HTMLDoc2.getElementByName("selDate")(0).SelectedIndex = 2
'HTMLDoc2.getElementByName("selDate")(0).FireEvent ("onchange")
'HTMLDoc2.getElementsByName("Search")(0).Submit
HTMLDoc2.Forms("onlineReportFormBean").Submit
Do While IE.Busy Or IE.ReadyState <> 4: Loop
End Sub
问)我可以填写商家ID旁边的文本框,但我无法使用上面的代码选择第二个索引... May2016。
HTMLDoc2.getElementByName("selDate")(0).SelectedIndex = 2
上面一行给出错误:对象不支持此属性或方法
Q2)我也无法点击&#34;搜索&#34;。
HTMLDoc2.Forms("onlineReportFormBean").Submit
行给出了自动化错误..