有關EXCEL VBA 抓取不到完整網址CSV問題
- 帖子
- 2
- 主題
- 0
- 精華
- 0
- 積分
- 8
- 點名
- 0
- 作業系統
- WIN
- 軟體版本
- VISTA
- 閱讀權限
- 10
- 性別
- 男
- 註冊時間
- 2011-11-6
- 最後登錄
- 2019-9-2
|
Sub TEXT_102()
Dim YMD_day As String, N As Name, webURL As String
YMD_day = InputBox("輸入 民國年度日期 : 102/10/07", "下載特定日期的資料", Format(Date - 1, "E/MM/DD"))
With Sheets("下載資料")
For Each N In .Names
'N.Delete
Next
.Cells.Clear
GetData_URL = "URL;http://www.twse.com.tw/ch/trading/block/BFIAUU/BFIAUU.php?edition=ch&filename=genpage/A" & YMD_day & ".dat&type=csv"
'webURL = "URL; http://www.twse.com.tw/ch/trading/block/BFIAUU/BFIAUU.php?input_date=" & YMD_day & "&login_btn=查詢.dat"
With .QueryTables.Add(Connection:=GetData_URL, Destination:=.Range("A1"))
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "data_table"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = False
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = True
.Refresh BackgroundQuery:=False
End With
End With
End Sub |
|
|
|
|
|
|
|