- 帖子
- 1018
- 主題
- 15
- 精華
- 0
- 積分
- 1058
- 點名
- 0
- 作業系統
- win7 32bit
- 軟體版本
- Office 2016 64-bit
- 閱讀權限
- 50
- 性別
- 男
- 來自
- 桃園
- 註冊時間
- 2012-5-9
- 最後登錄
- 2022-9-28
|
回復 活力充沛
日期參數是 input_date , 分類項目參數是 select2
你可以試看看query網址用像這樣的格式
http://www.twse.com.tw/ch/trading/fund/T86/T86.php&input_date=101/10/19&select2=13
...
stillfish00 發表於 2012-10-21 11:52 
抱歉 說錯了 , 不是query網址 , 應該是postText
像這樣去改變參數
Dim selectDate As String, selectType As String
selectDate = "101/10/19"
selectType = "13"
With QueryTables(1)
.Connection = "URL;http://www.twse.com.tw/ch/trading/fund/T86/T86.php"
.PreserveFormatting = False
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebDisableDateRecognition = True
.WebTables = "9"
.PostText = "input_date=" & selectDate & "&select2=" & selectType
.Refresh False
End With |
|