VBA在IE中选择列表

时间:2017-10-10 16:49:06

标签: excel-vba vba excel

我一直在尝试使用VBA打开IE窗口并从显示bwin的下拉列表中选择但是失败了。有什么建议吗?

Private Sub OKButton_Click()

Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Silent = True
.Visible = True
.Navigate "http://www.yahoo.com/"
End With

While ie.ReadyState <> 4 Or ie.Busy: DoEvents: Wend

Set AvailableLinks = oIE.document.getelementbyid("list-listing").getelementsbytagname("a")

    For Each cLink In AvailableLinks
        If cLink.innerhtml = "????" Then
            cLink.Click
        End If
    Next cLink
End Sub

0 个答案:

没有答案