Excel QueryTable随着时间的推移逐渐变慢,直到冻结为止

时间:2018-04-30 14:51:32

标签: excel vba performance import freeze

我有一个运行查询表的代码,将数据导入工作表,然后在数据上运行其他代码。

我有一个定时器,每90秒运行一次。一切都正常,但随着时间的推移,它变得越来越慢。最终(大约12小时后),它完全冻结了。我尝试清除代码末尾的连接,但这并没有解决问题。

有什么想法吗?

 With ActiveSheet.QueryTables.Add(Connection:= _
    "URL;http://www.address.com" _
    , Destination:=sh3.Range("$A$1"))
    .Name = "Query"
    .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

0 个答案:

没有答案
相关问题