- 帖子
- 155
- 主題
- 1
- 精華
- 0
- 積分
- 200
- 點名
- 4
- 作業系統
- windwos 7
- 軟體版本
- 64bit
- 閱讀權限
- 20
- 註冊時間
- 2017-5-29
- 最後登錄
- 2026-10-25
|
回復 1# verify9k
GBKEE大,寫的很多ie範例也可以用,程式碼長度跟 QueryTables.Add差不多,簡單易懂
Sub Ex()
Dim R As Integer, C As Integer
With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "https://goodinfo.tw/StockInfo/ShowSaleMonChart.asp?STOCK_ID=2330"
Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
With .Document.all.tags("table")(21)
For R = 0 To .Rows.Length - 1
For C = 0 To .Rows(R).Cells.Length - 1
ActiveSheet.Cells(R + 1, C + 1) = .Rows(R).Cells(C).innerText
Next
Next
End With
.Quit
End With
End Sub |
|