- 帖子
- 112
- 主題
- 19
- 精華
- 0
- 積分
- 136
- 點名
- 0
- 作業系統
- window
- 軟體版本
- excel
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2013-3-12
- 最後登錄
- 2022-11-29

|
[發問] 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 |
|