Excel VBA QueryTables TEXT与URL连接

我有以下两段代码用于从Web服务中提取大型表格,一个用于URL连接:

With ActiveSheet.QueryTables.Add(Connection:="URL;" & URL, Destination:=Cells(1,1)) .PostText = "" .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = False .RefreshStyle = xlOverwriteCells .SavePassword = False .AdjustColumnWidth = False .RefreshPeriod = 0 .WebSelectionType = xlEntirePage .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = False .WebSingleBlockTextImport = True .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False .WorkbookConnection.Delete End With 

还有一个用于TEXT连接:

 With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & URL, Destination:=Cells(1,1)) .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .RefreshStyle = xlOverwriteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = False .RefreshPeriod = 0 .TextFilePromptOnRefresh = False .TextFilePlatform = 850 .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = True .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = False .TextFileSpaceDelimiter = False .TextFileColumnDataTypes = Array(1, 1, 1, 1) .TextFileTrailingMinusNumbers = True .Refresh BackgroundQuery:=False .WorkbookConnection.Delete End With 

因为我有时需要将参数发送到Web服务(通过PostText或长URL),URL连接更适合我的目的。 但是,对于来自同一Web服务的相同数据集(本例中不带参数),刷新一直需要21秒的URL连接,而TEXT连接只需12秒。

是否有一个原因,为什么文本连接速度如此之快? 有什么我可以做的关于URL连接的相对缓慢?