返回列表 上一主題 發帖

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

上櫃盤後資料CSV下載問題

各位大大您好:請問
網址http://www.otc.org.tw/ch/stock/3insti/DAILY_TradE/3itrade.php
如何在網址列輸入網址分別下載日報表.周報表.月報表CSV
有參考http://forum.twbts.com/thread-11030-1-1.html這篇
http://www.otc.org.tw/ch/stock/3insti/DAILY_TradE/3itrade_download.php?d=102/12/31這樣不行
不知道還要分別加入什麼才能下載日報表.周報表.月報表CSV
請大大指教 謝謝

TOP

本帖最後由 GBKEE 於 2014-1-2 11:23 編輯

回復 1# jerrystock

http://www.otc.org.tw/ch/stock/3insti/DAILY_TradE/3itrade_download.php?t=D&d=102/12/31&s=0
感恩的心......(在麻辣家族討論區.用心學習會有進步的)
但資源無限,後援有限,  一天1元的贊助,人人有能力.

TOP

非常感謝GBKEE大大快速地解決我的疑問謝謝您

TOP

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

各位大大您好:請問
上櫃股票融資融券餘額CSV下載 :
網址:http://www.otc.org.tw/ch/stock/margin_trading/margin_balance/margin_bal.php

以:http://www.otc.org.tw/ch/stock/margin_trading/margin_balance/margin_bal_download.php?d=103/01/03&s=0,asc,1

產生下情況
代號,  名稱,  前資餘額(張),  資買,  資賣,  現償,  資餘額,  資屬證金, 資使用率(%), 資限額,,  券餘額,  券屬證金,  券使用率(%), 券限額,  資券相抵(張),  備註
1259  ,"安心","303","2","0","0","305","6","3.77","8,097","0","0","0","0","0","0","0.0","8,097","0","1     C    "                                                                       
1333  ,"恩得利","0","0","0","0","0","0","0.0","21,275","0","0","0","0","0","0","0.0","21,275","0"," OX        "                                                                       

請大大指教 謝謝

回復 4# tsuneng
  1. Option Explicit
  2. Sub Ex()
  3.    Workbooks.Open Filename:="http://www.otc.org.tw/ch/stock/margin_trading/margin_balance/margin_bal_download.php?d=103/01/03&s=0"
  4. End Sub
複製代碼
感恩的心......(在麻辣家族討論區.用心學習會有進步的)
但資源無限,後援有限,  一天1元的贊助,人人有能力.

TOP

謝謝大大 回應!
因我是由網上自學VBA , 故東拼西湊, 可否請大大指教, 我下列程式錯誤地方

' 上櫃股票融資融券餘額
Theurl = "http://www.otc.org.tw/ch/stock/margin_trading/margin_balance/margin_bal_download.php?d=" & Sdate & "&s=0"

   With ActiveSheet.QueryTables.Add(Connection:="URL;" & Theurl, Destination:=Range("b1"))
            .BackgroundQuery = True
            .RefreshStyle = xlOverwriteCells
            .RefreshPeriod = 0
            .AdjustColumnWidth = False
            .WebSelectionType = xlSpecifiedTables
            .WebFormatting = xlWebFormattingNone
            .WebTables = "1,2,3,4"
            .WebDisableDateRecognition = True         '關閉日期辨識
            .Refresh BackgroundQuery:=False
            .Delete

End With

會出現
1259  ,"安心","303","2","0","0","305","6","3.77","8,097","0","0","0","0","0","0","0.0","8,097","0","1     C    "

請大大指教 謝謝

TOP

回復 6# tsuneng

試用資料剖析看看

TOP

回復 6# tsuneng
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Theurl As String, Sdate
  4.     Theurl = "http://www.otc.org.tw/ch/stock/margin_trading/margin_balance/margin_bal_download.php?d=" & Sdate & "&s=0"
  5.     With ActiveSheet.QueryTables.Add(Connection:="URL;" & Theurl, Destination:=Range("b1"))
  6.         .BackgroundQuery = True
  7.         .RefreshStyle = xlOverwriteCells
  8.         .RefreshPeriod = 0
  9.         .AdjustColumnWidth = False
  10.         .WebSelectionType = xlSpecifiedTables
  11.         .WebFormatting = xlWebFormattingNone
  12.         '.WebTables = "1,2,3,4"
  13.         .WebDisableDateRecognition = True         '關閉日期辨識
  14.         .Refresh BackgroundQuery:=False
  15.         .ResultRange.Columns(1).TextToColumns Destination:=.ResultRange.Cells(1), DataType:=xlDelimited, _
  16.                 TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
  17.                 Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
  18.                 :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
  19.                 Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1 _
  20.                 ), Array(14, 1), Array(15, 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array _
  21.                 (20, 1)), TrailingMinusNumbers:=True
  22.             'TextToColumns 方法 (資料剖析)的參數可錄製得到
  23.             'ResultRange.Columns(1):weby資料的第一欄
  24.             'ResultRange.Cells(1)  :weby資料的第一個Cells(儲存格)
  25.             .Delete
  26.     End With
  27. End Sub
  28. Sub Ex1()
  29.     Dim Theurl As String, Sdate, AR
  30.     Sdate = "103/01/03"
  31.     Theurl = "http://www.otc.org.tw/ch/stock/margin_trading/margin_balance/margin_bal_download.php?d=" & Sdate & "&s=0"
  32.     With Workbooks.Open(Theurl)
  33.         AR = .Sheets(1).UsedRange
  34.         .Close False
  35.     End With
  36.     With ActiveSheet
  37.         .UsedRange.Clear
  38.         .Range("A1").Resize(UBound(AR, 1), UBound(AR, 2)) = AR
  39.    
  40.     End With
  41. End Sub
複製代碼
感恩的心......(在麻辣家族討論區.用心學習會有進步的)
但資源無限,後援有限,  一天1元的贊助,人人有能力.

TOP

感恩!! 學習中

TOP

回復 5# GBKEE


      請問版主
我將上述網址換成 http://www.otc.org.tw/ch/stock/3insti/DAILY_TradE/3itrade_download.php?t=D&d=102/12/31&s=0 這一段
結果只下載了表頭,沒有下載資料內容
請問該如何修改
謝謝!!

TOP

        靜思自在 : 【行善要及時】行善要及時,功德要持續。如燒開水一般,未燒開之前千萬不要停熄火候,否則重來就太費事了。
返回列表 上一主題