返回列表 上一主題 發帖

上櫃股票融資融券餘額CSV下載問題

回復 10# pupai


    報告G大
我知道問題在哪了
謝謝~打擾

TOP

回復 2# GBKEE


    請問G大
我想要指定日期下載
但一直沒能成功
可以幫我看看麻
謝謝!!
  1. Sub EXC()
  2.     Dim Theurl As String, Sdate
  3.     Dim URL As String, xDate As Date, A As Date
  4.    
  5. A = Range("A1").Value
  6.   xDate = Format(A, "E/M/D")

  7. Theurl = "http://www.otc.org.tw/ch/stock/3insti/DAILY_TradE/3itrade_download.php?t=D&d=& xDate &s=0"
  8.         

  9.     With ActiveSheet.QueryTables.Add(Connection:="URL;" & Theurl, Destination:=Range("A2"))
  10.         .BackgroundQuery = True
  11.         .RefreshStyle = xlOverwriteCells
  12.         .RefreshPeriod = 0
  13.         .AdjustColumnWidth = False
  14.         .WebSelectionType = xlSpecifiedTables
  15.         .WebFormatting = xlWebFormattingNone
  16.         '.WebTables = "1,2,3,4"
  17.         .WebDisableDateRecognition = True         '關閉日期辨識
  18.         .Refresh BackgroundQuery:=False
  19.         .ResultRange.Columns(1).TextToColumns Destination:=.ResultRange.Cells(1), DataType:=xlDelimited, _
  20.                 TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
  21.                 Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
  22.                 :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
  23.                 Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1 _
  24.                 ), Array(14, 1), Array(15, 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array _
  25.                 (20, 1)), TrailingMinusNumbers:=True
  26.             'TextToColumns 方法 (資料剖析)的參數可錄製得到
  27.             'ResultRange.Columns(1):weby資料的第一欄
  28.             'ResultRange.Cells(1)  :weby資料的第一個Cells(儲存格)
  29.             .Delete
  30.     End With
  31. End Sub
複製代碼

TOP

回復 12# pupai
找找看12#的程式碼,哪裡要修改!
  1. Sub EXC()
  2.     Dim Theurl As String, Sdate
  3.     Dim URL As String, xDate As String, A As Date
  4.     A = Range("A1").Value
  5.     xDate = Format(A, "E/MM/DD")
  6.     Theurl = "http://www.otc.org.tw/ch/stock/3insti/DAILY_TradE/3itrade_download.php?t=D&d=" & xDate & "&s=0"
複製代碼
感恩的心......(在麻辣家族討論區.用心學習會有進步的)
但資源無限,後援有限,  一天1元的贊助,人人有能力.

TOP

回復 13# GBKEE


    報告G大
12#部分不知道哪要修改
請指導!
謝謝

TOP

回復 13# GBKEE


     請問版主
我想下在在網站的資料
http://www.twse.com.tw/ch/trading/fund/T86/T86.php
但我的為什麼程式的執行階段有錯誤
請指導 謝謝!!
  1. Sub E()
  2.         
  3.     Dim URL As String, xDate As Date, A As Date
  4.     A = Range("A2").Value
  5.     xDate = Format(A, "E/M/D")


  6. ReDate:
  7.     URL = "URL; http://www.twse.com.tw/ch/trading/fund/T86/T86.php?qdate=" & xDate
  8.     With ActiveSheet.QueryTables.Add(Connection:=URL, Destination:=Range("B1"))
  9.         .WebSelectionType = xlSpecifiedTables
  10.         .WebFormatting = xlWebFormattingNone
  11.         .WebTables = "5"
  12.         .WebPreFormattedTextToColumns = True
  13.         .WebConsecutiveDelimitersAsOne = True
  14.         .WebSingleBlockTextImport = False
  15.         .WebDisableDateRecognition = False
  16.         .WebDisableRedirections = False
  17.         .Refresh BackgroundQuery:=False
  18.         
  19.     End With


  20. End Sub
複製代碼

TOP

本帖最後由 GBKEE 於 2014-6-20 06:45 編輯

回復 15# pupai
搜尋 一下 這網址
感恩的心......(在麻辣家族討論區.用心學習會有進步的)
但資源無限,後援有限,  一天1元的贊助,人人有能力.

TOP

回復  jerrystock
GBKEE 發表於 2014-1-2 11:19



想請教GBKEE大大是如何取得csv下載點的?
因為本身是初學者,被下載點的問題困擾很久,
再麻煩大大賜教,感謝感謝

TOP

想請教GBKEE大大是如何取得csv下載點的?
因為本身是初學者,被下載點的問題困擾很久,
再麻煩大大賜 ...
yungchan 發表於 2014/7/28 07:49

那要看網頁是否提供csv檔(要找找看)
感恩的心......(在麻辣家族討論區.用心學習會有進步的)
但資源無限,後援有限,  一天1元的贊助,人人有能力.

TOP

        靜思自在 : 是非當教育,讚美作警惕。
返回列表 上一主題