返回列表 上一主題 發帖

[發問] ie11+office2010,透過vba下載yahoo 的股價要花上30秒左右

[發問] ie11+office2010,透過vba下載yahoo 的股價要花上30秒左右

最近換系統,ie11+office2010,透過vba下載yahoo 的股價總是要花上30秒左右,
才有辦法將資料抓下來,先前頂多3~5秒而已(ie9+office2003)。

透過以下的設定,發現是跑到SQL (.Refresh BackgroundQuery:=False),
在抓取資料才停格,請問在不動系統的情況下有辦法減少下載時間嗎?

   With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;" & WebAddress, Destination:=Selection) '新增查詢
               
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlSpecifiedTables
        .WebFormatting = xlWebFormattingNone
        .WebTables = X
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
        .Name = .ResultRange.Cells(3, 1)
    End With

        靜思自在 : 做該做的事是智慧,做不該做的事是愚癡。
返回列表 上一主題