ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¥æ©ö©ú²Ó¤U¸ü

¥æ©ö©ú²Ó¤U¸ü

http://bsr.twse.com.tw/bshtm/

³o­Óºô¯¸¤ñ¸û¦³¤H©Ê¤@ÂI  °Ñ¼Æ§äªº¨ì¤]¥i¥H³]©w

¦ý¬O§Ú¤£ª¾¹D­¶¼Æ¦³´X±i

¤gªk·Ò¿û¤@­¶¤@­¶§Ë¤]«Ü¨S¦³®Ä²v

¬d¸ß¤Ó¦h¦¸ÁÙ·|³QÀÉ

½Ð°Ýµ{¦¡¸Ó¦p¦ó¤U¸ü
  1. Sub ­ÓªÑ¥æ©ö©ú²Ó¤U¸ü()
  2.     Dim ªÑ²¼¥N¸¹ As String, ¤é´Á As Variant, N, i As Integer, A, T As Date
  3.     Do While Not IsDate(¤é´Á)
  4.         ¤é´Á = InputBox("¿é¤J¬d¸ß¤é´Á", "¤é´Á", Date)
  5.         If ¤é´Á = "" Then End
  6.     Loop
  7.     Do While ªÑ²¼¥N¸¹ = ""
  8.         ªÑ²¼¥N¸¹ = InputBox("ªÑ²¼¥N¸¹", "¿é¤J¬d¸ß¤§ªÑ²¼¥N¸¹", "1101")
  9.         If ¤é´Á = "" Then End
  10.     Loop
  11.     ¤é´Á = Format(¤é´Á, "yyyymmdd")
  12.     T = Time
  13.     With ActiveSheet
  14.         For Each N In .Names
  15.             N.Delete
  16.         Next
  17.         .Cells.Clear
  18.         Application.StatusBar = False
  19.         On Error GoTo A_Wait
  20.         With .QueryTables.Add(Connection:="URL;http://bsr.twse.com.tw/bshtm/bshtm_report_Messages.aspx?strDate=" & ¤é´Á & "&StartNumber=" & ªÑ²¼¥N¸¹ & "&FocusIndex=1", Destination:=Range("A1"))
  21.             .Name = ¤é´Á & "_" & ªÑ²¼¥N¸¹ & "_1"
  22.             .FieldNames = True
  23.             .RowNumbers = False
  24.             .FillAdjacentFormulas = False
  25.             .PreserveFormatting = True
  26.             .RefreshOnFileOpen = False
  27.             .BackgroundQuery = True
  28.             .RefreshStyle = xlInsertDeleteCells
  29.             .SavePassword = False
  30.             .SaveData = True
  31.             .AdjustColumnWidth = True
  32.             .RefreshPeriod = 0
  33.             .WebSelectionType = xlEntirePage
  34.             .WebFormatting = xlWebFormattingNone
  35.             .WebPreFormattedTextToColumns = True
  36.             .WebConsecutiveDelimitersAsOne = True
  37.             .WebSingleBlockTextImport = False
  38.             .WebDisableDateRecognition = False
  39.             .WebDisableRedirections = False
  40.             .Refresh BackgroundQuery:=False
  41.             If Application.CountA(.ResultRange) = 0 Then
  42.                 MsgBox Format(¤é´Á, "0000/00/00") & " ¥ð¥«!!!  ©Î  ªÑ²¼¥N¸¹:" & ªÑ²¼¥N¸¹ & " ¿ù»~ !!!"
  43.                 [A1].Select
  44.                 End
  45.             End If
  46.         End With
  47.         i = 2
  48.         Do
  49.             .Cells(Rows.Count, 1).End(xlUp).Offset(1).Select
  50.             With .QueryTables.Add(Connection:="URL;http://bsr.twse.com.tw/bshtm/bshtm_report_Messages.aspx?strDate=" & ¤é´Á & "&StartNumber=" & ªÑ²¼¥N¸¹ & "&FocusIndex=" & i, Destination:=Selection)
  51.                 .Name = ¤é´Á & "_" & ªÑ²¼¥N¸¹ & "_" & i
  52.                 .WebSelectionType = xlSpecifiedTables
  53.                 .WebFormatting = xlWebFormattingNone
  54.                 .WebTables = "6"
  55.                 .WebPreFormattedTextToColumns = True
  56.                 .WebConsecutiveDelimitersAsOne = True
  57.                 .WebSingleBlockTextImport = False
  58.                 .WebDisableDateRecognition = False
  59.                 .WebDisableRedirections = False
  60.               ''''''µLªk¬d¸ß®Éµy«Ý  ¨ì  A_Wait: '''''
  61.                 .Refresh BackgroundQuery:=False
  62.                 If Application.CountA(.ResultRange) = 0 Then GoTo Out
  63.                 i = i + 1
  64.             End With
  65.             A = CreateObject("WScript.Shell").popup("½Ðµ¥«á¤U¸ü..." & Chr(10) & Chr(10) & "** ½Ð¤Å«ö¤U ** [½T©w]", 4, ¤é´Á & "_" & .[F2] & "  ²Ä" & i & "­¶", 16 * 3 + 0)
  66.             Application.ScreenUpdating = True
  67.         Loop
  68. Out:
  69.         .UsedRange.Columns.AutoFit
  70.         .[A1].Select
  71.         A = CreateObject("WScript.Shell").popup("¦@¤U¸ü" & i & "­¶", 5, ¤é´Á & "_" & ªÑ²¼¥N¸¹, 48 + 0)
  72.         Application.StatusBar = "¦@¤U¸ü " & i & "­¶ ¶O®É " & Format(Time - T, "HH:MM:SS")
  73.     End With
  74.     End
  75. A_Wait:
  76.     Application.StatusBar = "µLªk¬d¸ßµ¥­Ô10¬íÄÁ"
  77.     Application.Wait Now + TimeValue("00:00:10")
  78.     Err.Clear
  79.     Application.StatusBar = False
  80.     Resume    '­«ªð¬d¸ß
  81. End Sub
½Æ»s¥N½X
¥H«e¥i¥H¤U¸ü¨ì...²{¦b¤U¤£¨ì¡A½Ð¨D°ª¤â¸Ñ´b

¦n¼F®`¡I¼F®`......
¦¨¥\¤F
µ¥«Ýª©¥D¤À¨É§¹¾ã¤U¸ü¤WÂd¸ê®Æ¤º½X
·P®¦

TOP

¦^´_ 34# GBKEE

¸Õ¤F,¦¨¥\!!  GBKEE ªGµM¬O°ª¤H,ÁÂÁ¼ö¤ß¬Û§U!!!

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-8-11 06:54 ½s¿è

¦^´_ 33# diabo
·PÁ¬ۧU ¦¨¥\!
  1. Option Explicit
  2. Private Sub ¤U¸ühtm()
  3.     Dim xml As Object     '¥Î¨Ó¨ú±oºô­¶¸ê®Æ
  4.     Dim stream            'As ADODB.stream   '¥Î¨ÓÀx¦s¤G¶i¦ìÀÉ®×
  5.     Dim URL As String     '¥Øªººô§}
  6.     Dim thePOSTdata       '°Ñ¼Æ
  7.     Set xml = CreateObject("Microsoft.XMLHTTP")
  8.     Set stream = CreateObject("ADODB.stream")
  9.     URL = "http://www.gretai.org.tw/ch/stock/aftertrading/broker_trading/download_ALLCSV.php"
  10.     thePOSTdata = "curstk=3527&stk_date=1010810"
  11.         xml.Open "POST", URL, 0
  12.         xml.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  13.         xml.send thePOSTdata
  14.     With stream
  15.         .Open
  16.         .Type = 1
  17.         .write xml.ResponseBody
  18.         If Dir("D:\3527.CSV") <> "" Then Kill "D:\3527.CSV"
  19.         .SaveToFile ("D:\3527.CSV")                              
  20.         .Close
  21.     End With
  22. Set xml = Nothing
  23. Set stream = Nothing
  24. End Sub
½Æ»s¥N½X

TOP

¦^´_ 31# GBKEE


    Âd¶R¤¤¤ßªº³o­ÓSERVERºÝµ{¦¡¥u±µ¦¬ POST¶Ç»¼ (GET¶Ç»¼µL®Ä) ªº¸ê®Æ¡A¶·±Ä¥Î XMLHTTP ¥H POST ¶Ç»¼ thePOSTdata¡A¨ú±o response «áª½±µ¦s¦¨ csv §Y¥i
  1.    thePOSTdata = "curstk=" & ªÑ²¼¥N½X & "&fromw=0&numbern=100&stk_date=" & ¸ê®Æ¤é´Á    '¤é´Á®æ¦¡ 1010730
  2.    thePOSTActionFile = "http://www.gretai.org.tw/ch/stock/aftertrading/broker_trading/download_ALLCSV.php"

  3.    Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP")
  4.    oXMLHTTP.Open "POST", thePOSTActionFile, False
  5.    oXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  6.    
  7.    'send request - POST
  8.     oXMLHTTP.send thePOSTdata
  9. ....
½Æ»s¥N½X
diabo

TOP

¦^´_ 31# GBKEE
ÁÂÁÂGBKEE ¤j¤j ¼ö¤ß¤À¨É¡A·P®¦!!

TOP

¦^´_ 26# tsuneng
Åý§A¥¢±æ¤F, ¸Õ¤F¤@¤Ñ ¤´¬O¥¢±Ñ ¹ïºô­¶»y¨¥¤£¼ô µLªk¤U¸ü ³oºô§}©Ò¦³ªº¸ê®Æ
http://www.gretai.org.tw/ch/stock/aftertrading/broker_trading/brokerBS.php?  À|¸Õ¥Î IE ¤U¸üTables ªº¤º®e ¦ýÁÙ¬O¥¢±Ñ
¦phttp://forum.twbts.com/viewthread.php?tid=7395&page=1&extra=#pid42189 ªº5# ªþÀÉ
³ohttp://www.gretai.org.tw/ch/stock/aftertrading/broker_trading/download_ALLCSV.php?'¥i¤U¸ü¥þ³¡CSV: ¦ý¹ïºô­¶¬[ºc¤£¼ô,¼g¤£¥X¥¦ªº°Ñ¼Æ
±æª¾±xªÌ¬Û§U
¥Î EXCEL  WEBªº¬d¸ß¤]¦³©Ò­­¨î,¥u¥i¬d¬Ý²Ä¤@­¶ªº¸ê®Æ,
  1. Option Explicit
  2. Sub Ex()
  3.     With ActiveSheet.QueryTables.Add("URL;http://www.gretai.org.tw/ch/stock/aftertrading/broker_trading/brokerBS.php?stk_code=6121", ActiveSheet.[A1])
  4.         .WebSelectionType = xlSpecifiedTables
  5.         .WebFormatting = xlWebFormattingNone
  6.         .WebTables = "11,13,14"
  7.         .Refresh BackgroundQuery:=False
  8.     End With
  9. End Sub
½Æ»s¥N½X

TOP

¦^´_ 29# lalalada


    ³oÃä¬Oxls,©Ò¥H
htm ªº§Ú¤À¨É¦b³o¤§«eªº°Q½×
http://forum.twbts.com/viewthrea ... a=pageD1&page=3

TOP

¦^´_ 28# HSIEN6001

¦n­C~
§Ú¤]¦b·Q«ç»ò§âhtm¨}¦nªºÂনcsv©Îxls
¦¨¥\ªº¸Ü§Ú¥Ø«eªº°ÝÃD´X¥G´N¥þ³¡¸Ñ¨M¤F

TOP

¦^´_ 27# lalalada

§Ú¤]ı±ocsv¤è«K,¤@¬í¦n´XÀÉ   (²n!)
¥i±¤!ÃÒ¥æ©Ò¨Ã¥¼±N®æ¦¡§Ë¦n,¸ê®Æ¦³¯Ê~~~§ã×N!

µ¥µ¥§Ú¤À¨Éhtm Âàxls
³oÃäµ¥G¤j¤À¨É,§Ú­Ì¥~¦æªº¨Ä¨Ä¦a
[µê¤ß¨D¾Ç]

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤Hªº§Ö¼Ö¡D¤£¬O¦]¬°¥L¾Ö¦³±o¦h¡A¦Ó¬O¦]¬°¥L­p¸û±o¤Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD