Excel查询表格式网站格式不正确

时间:2017-03-08 13:05:10

标签: excel vba

我有一些VBA代码已经运行了几年。代码是:

With ActiveSheet.QueryTables.Add(Connection:="URL;" & myURL, Destination:=Range("$A$1"))
    .Name = "Weather"
    .FieldNames = True
    .RowNumbers = False
    .FillAdjacentFormulas = False
    .PreserveFormatting = True
    .RefreshOnFileOpen = False
    .BackgroundQuery = True
    .RefreshStyle = xlOverwriteCells
    .SavePassword = False
    .SaveData = True
    .AdjustColumnWidth = True
    .RefreshPeriod = 0
    .WebSelectionType = xlEntirePage
    .WebFormatting = xlWebFormattingNone
    .WebPreFormattedTextToColumns = True
    .WebConsecutiveDelimitersAsOne = True
    .WebSingleBlockTextImport = False
    .WebDisableDateRecognition = False
    .WebDisableRedirections = False
    .Refresh BackgroundQuery:=False
End With

myURL在哪里:http://www.wunderground.com/history/airport/AMS/2011/1/1/CustomHistory.html?dayend=31&monthend=12&yearend=2011&req_city=NA&req_state=NA&req_statename=NA&format=1

用于返回逗号分隔文件的代码,我可以解析该文件以获取所需的数据。但是,在过去几天,代码返回一个完全格式化的网站。似乎“& format = 1”(需要返回逗号分隔文件)未被网站识别。

当我直接在Chrome或IE中输入网址时,我会收到以逗号分隔的文件。我的查询表没有运气(不再)谁能给我一些指导?

0 个答案:

没有答案