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

[µo°Ý] µ{¦¡»yªk¦³»~

[µo°Ý] µ{¦¡»yªk¦³»~

±z¦n
§Ú´¡¤J«ü©w¤é´Á«á¡Aµ{¦¡¿ù»~
½ÐÀ°¦£­×§ï
ÁÂÁÂ!!
  1. Sub ¥¨¶°()
  2.     Dim Theurl As String, Sdate, AR, A As Date
  3.    
  4.     A = Range("A1").Value
  5.     Sdate = Text(A1, "emmdd")
  6.      
  7.     Theurl = "http://www.twse.com.tw/ch/trading/fund/BFI82U/BFI82U_print.php?begin_date="&Sdate&end_date=&report_type=day&language=ch&save=csv"
  8.     With Workbooks.Open(Theurl)
  9.         AR = .Sheets(1).UsedRange
  10.         .Close False
  11.     End With
  12.     With ActiveSheet
  13.         
  14.    
  15.         
  16.         .Range("B2").Resize(UBound(AR, 1), UBound(AR, 2)) = AR
  17.    
  18.             
  19.      

  20.     End With
  21. End Sub
½Æ»s¥N½X

¦^´_ 1# pupai


    ¤é´Á®æ¦¡ :yyyymmdd
     Sdate = Text(A1, "emmdd")  ¬O¤£Ãѳo¥y¦³»~©O??
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

¦^´_ 2# hugh0620


    §Ú²q
    Theurl = "http://www.twse.com.tw/ch/trading/fund/BFI82U/BFI82U_print.php?begin_date="&Sdate&end_date=&report_type=day&language=ch&save=csv"

ÁÂÁÂ

TOP

¥»©«³Ì«á¥Ñ HSIEN6001 ©ó 2014-12-16 12:58 ½s¿è

¦^´_ 3# pupai


    ¥ÎCSV¤U¸ü,¦P http://forum.twbts.com/thread-13018-1-1.html   #6  
(¤@°_¤U¸ü)
  1. Sub CSV¤U¸ü()
  2. Dim path As String
  3. path = "C:\"
  4. ¤é´Á = "20141215"

  5. Set XML = CreateObject("Microsoft.XMLHTTP")
  6. Set stream = CreateObject("ADODB.stream")
  7.    
  8.     URL = "http://www.taifex.com.tw/chinese/3/7_12_8dl.asp?syear=" & VBA.Left(¤é´Á, 4) & "&smonth=" & VBA.Mid(¤é´Á, 5, 2) & "&sday=" & _
  9.             VBA.Right(¤é´Á, 2) & "&eyear=" & VBA.Left(¤é´Á, 4) & "&emonth=" & VBA.Mid(¤é´Á, 5, 2) & "&eday=" & VBA.Right(¤é´Á, 2)
  10.         XML.Open "GET", URL, 0
  11.         XML.send
  12.     With stream
  13.         .Type = 1
  14.         .Open
  15.         .write XML.responseBody
  16.         If Dir(path & "ÃþªÑ´Á³f" & ¤é´Á & ".csv") <> "" Then Kill (path & "ÃþªÑ´Á³f" & ¤é´Á & ".csv")
  17.         .SaveToFile (path & "ÃþªÑ´Á³f" & ¤é´Á & ".csv")
  18.         .Close
  19.     End With
  20.    
  21.     URL = "http://www.twse.com.tw/ch/trading/fund/BFI82U/BFI82U_print.php?begin_date=" & _
  22.             VBA.Left(¤é´Á, 8) & "&end_date=" & VBA.Left(¤é´Á, 8) & "&report_type=day&language=ch&save=csv"
  23.         XML.Open "GET", URL, 0
  24.         XML.send
  25.     With stream
  26.         .Type = 1
  27.         .Open
  28.         .write XML.responseBody
  29.         If Dir(path & "¤T¤jªk¤H¶R½æ¶W" & ¤é´Á & ".csv") <> "" Then Kill (path & "¤T¤jªk¤H¶R½æ¶W" & ¤é´Á & ".csv")
  30.         .SaveToFile (path & "¤T¤jªk¤H¶R½æ¶W" & ¤é´Á & ".csv")
  31.         .Close
  32.     End With

  33. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# HSIEN6001


    ·PÁ¦^´_
«á¨Ó§Ú¥Î¤g¤èªk
  1. Sub ¥¨¶°()
  2.    
  3.    
  4.     Dim Theurl As String, Sdate, AR, A As Date
  5.    
  6.     A = Range("A1").Value
  7.     Sdate = Format(A, "yyyymmdd")

  8.    
  9.     Theurl = "http://www.twse.com.tw/ch/trading/fund/BFI82U/BFI82U_print.php?begin_date=" & Sdate & "&end_date=" & Date & "&report_type=day&language=ch&save=csv"
  10.    
  11.    
  12.             
  13.    
  14.    
  15.     With Workbooks.Open(Theurl)
  16.         AR = .Sheets(1).UsedRange
  17.         .Close False
  18.     End With
  19.     With ActiveSheet
  20.          
  21.         .Range("B2").Resize(UBound(AR, 1), UBound(AR, 2)) = AR
  22.    
  23.     End With
  24. End Sub
½Æ»s¥N½X

TOP

¦^´_ 5# pupai

¥i¯à¬O³o­Ó°ÝÃD  path = "C:\"     
³o¬O«ü©w¦s  C:\
¦pªG§A¨S¦³ª½±µÅv­­ , ¦Û¤v«Ø¥ß¤@­Ó¸ê®Æ§¨
§ï¦¨¬°§A¨Ï¥ÎªÌ¥i¦sÀɪº¦ì¸m

TOP

¦^´_ 3# pupai
  1. Sub ¥¨¶°()
  2.     Dim Theurl As String, Sdate, AR, A As Date
  3.     A = Range("A1").Value
  4.     Sdate = Format(A, "yyyymmdd")   
  5.     Theurl = "http://www.twse.com.tw/ch/trading/fund/BFI82U/BFI82U_print.php?begin_date=" & Sdate & "&end_date=&report_type=day&language=ch&save=csv"
  6.     With Workbooks.Open(Theurl)
  7.         AR = .Sheets(1).UsedRange
  8.         .Close False
  9.     End With
  10.     With ActiveSheet
  11.         .Range("B2").Resize(UBound(AR, 1), UBound(AR, 2)) = AR
  12.     End With
  13. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 7# GBKEE


    ÁÂÁÂ ¦^´_

TOP

        ÀR«ä¦Û¦b : §Ñ¥\¤£§Ñ¹L¡A§Ñ«è¤£§Ñ®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD