Unable to opening a Menu Item...VBA code

时间:2016-06-10 16:15:14

标签: excel vba excel-vba

Whats wrong with the code:

I am trying to open a Menu Item on a webpage ...

Do While IE.Busy Or IE.ReadyState <> 4: Loop ' opening the third webpage
  Application.Wait (Now + TimeValue("00:01:10"))
  Set HTMLDoc3 = IE.Document

  With HTMLDoc3
  Set objCollection_2 = HTMLDoc3.getElementById("reportsmenucomponent") 'Selecting the MENU Item
  objCollection_2.Click ' Click on the menu Item.
  End With
  End Sub

The error message reads "Object Required".... What other objects can be used to recover the ID for Menu Item?? By object required what does it mean ...is it not able to read the ID "reportsmenucomponent" or the getelementbyid??

1 个答案:

答案 0 :(得分:0)

得到了解决方案: 这是一个Javascript ....所以网页保持与相同的URL链接....但开发人员选项卡上的menuotem网址有一个解析链接...我只是连接MenuItem URL与主URL链接deblink它到下一页。

IE浏览“http://..../parsed网址”