EXCEL VBA - 运行时错误91对象变量或未设置块变量

时间:2016-07-14 09:25:31

标签: excel excel-vba vba

我是宏的新手,所以我只编写了一组行,我得到一个运行时error 91说明"对象变量或者没有设置块变量"

下面提到了代码段

Public Function getreq()   
    Dim ie As InternetExplorer
    Dim elem As HTMLBaseElement
    Dim url As String
    url = "myURL"
    Set ie = New InternetExplorer
    ie.Visible = True
    ie.Navigate url
    WaitBrowserQuiet ie

    Set elem = getXPathElement("id('list-display-wrapper-left')/x:span/x:span[5]", ie.Document)
    MsgBox (elem.innerText)

    Set ie = Nothing


End Function

Code Snippet image

0 个答案:

没有答案