Excel运行时错误1004 - 无法打开

时间:2016-05-19 13:21:59

标签: excel vba excel-vba

当我尝试运行以下代码时,我收到运行时错误1004:

    Sub Macro3()

    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;https://www.google.com/finance?q=NYSEMKT%3AACY&fstype=ii&ei=P7Y9V8HkHcrCU-GgqDg#" _
        , Destination:=Range("$D$4"))
        .Name = "finance?q=NYSEMKT%3AACY&fstype=ii&ei=P7Y9V8HkHcrCU-GgqDg#_1"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlAllTables
        .WebFormatting = xlWebFormattingNone
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
End Sub

当我在MS Excel 2010上运行它时,此代码可以正常工作,但是当我在2013年运行它时,我收到错误消息,说它无法打开链接。该链接是Google财经上财务数据的正确链接。

有什么建议吗?

0 个答案:

没有答案