Excel宏不会连接到外部源

时间:2017-07-28 22:17:26

标签: excel vba excel-vba

我有一个excel程序已经运行了好几年,但最近拒绝连接到特定的站点来提取数据,但只能在我的计算机上工作。

它适用于家庭,适用于其他100名使用该程序的人。它可能已经开始出现在计算机上最近安装Windows10的问题,但我不能确定它是什么时候开始的,因为我有一段时间没有运行它。此外,我可以从同一网络上的浏览器直接进入链接。只是不通过Excel。

是否存在可能导致此问题的网络问题? 还有其他想法吗? 我完全不知道它只发生在我办公室的电脑上。

以下是代码:

addrndfd ="网址; http://graphical.weather.gov/xml/SOAP_server/ndfdXMLclient.php?whichClient=NDFDgen&lat=38.99&lon=-77.01&product=time-series&begin=2004-01-01T00%3A00%3A00&end=2016-01-01T00%3A00%3A00&Unit=e&maxt=maxt&mint=mint&temp=temp&qpf=qpf&pop12=pop12&snow=snow&dew=dew&wspd=wspd&wdir=wdir&sky=sky&Submit=Submit"

Sheets("NDFD_Raw").Select
With ActiveSheet.QueryTables.Add(Connection:=addrndfd, Destination:=Range("$A$1"))
    .Name = "getmex.pl?sta=KMSP"
    .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 = False
    .WebConsecutiveDelimitersAsOne = True
    .WebSingleBlockTextImport = False
    .WebDisableDateRecognition = False
    .WebDisableRedirections = False
    .Refresh BackgroundQuery:=False
End With


Range("A1").Select

错误:Error Screen Grab

0 个答案:

没有答案