我想编写代码来单击网站中的菜单。Sub SearchBot() Dim ie As Object Dim HTMLDoc As MSHTML.HTMLDocument Dim ckt_No As String ckt_No = Range("A2").Value Set ie = CreateObject("InternetExplorer.Application") ie.Visible = True ShowWindow ie.hwnd, SW_MAXIMIZE ie.Navigate "http://gamit.web.att.com/gamitx/welcome.htm" Do While ie.Busy = True Or ie.ReadyState <> 4: DoEvents: Loop Set HTMLDoc = ie.Document HTMLDoc.getElementById("yui-gen1").Focus HTMLDoc.getElementById("yui-gen1").Click Do While ie.Busy = True Or ie.ReadyState <> 4: DoEvents: Loop Stop 'Press SHIFT + F9 and examine the window...菜单在检查菜单时我得到了 HTML 代码VBA 没有抛出任何错误,但它没有单击菜单。运行代码后菜单如下所示我的 VBA 编辑器中有 Microsoft Internet 控件、Microsoft HTML 对象库函数。
- 2 回答
- 0 关注
- 106 浏览
添加回答
举报
0/150
提交
取消