- ©«¤l
- 219
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 243
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows10
- ³nÅ骩¥»
- Office2016
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2012-4-18
- ³Ì«áµn¿ý
- 2022-2-7
|
¥»©«³Ì«á¥Ñ HSIEN6001 ©ó 2014-12-16 12:58 ½s¿è
¦^´_ 3# pupai
¥ÎCSV¤U¸ü,¦P http://forum.twbts.com/thread-13018-1-1.html #6
(¤@°_¤U¸ü)- Sub CSV¤U¸ü()
- Dim path As String
- path = "C:\"
- ¤é´Á = "20141215"
- Set XML = CreateObject("Microsoft.XMLHTTP")
- Set stream = CreateObject("ADODB.stream")
-
- URL = "http://www.taifex.com.tw/chinese/3/7_12_8dl.asp?syear=" & VBA.Left(¤é´Á, 4) & "&smonth=" & VBA.Mid(¤é´Á, 5, 2) & "&sday=" & _
- VBA.Right(¤é´Á, 2) & "&eyear=" & VBA.Left(¤é´Á, 4) & "&emonth=" & VBA.Mid(¤é´Á, 5, 2) & "&eday=" & VBA.Right(¤é´Á, 2)
- XML.Open "GET", URL, 0
- XML.send
- With stream
- .Type = 1
- .Open
- .write XML.responseBody
- If Dir(path & "ÃþªÑ´Á³f" & ¤é´Á & ".csv") <> "" Then Kill (path & "ÃþªÑ´Á³f" & ¤é´Á & ".csv")
- .SaveToFile (path & "ÃþªÑ´Á³f" & ¤é´Á & ".csv")
- .Close
- End With
-
- URL = "http://www.twse.com.tw/ch/trading/fund/BFI82U/BFI82U_print.php?begin_date=" & _
- VBA.Left(¤é´Á, 8) & "&end_date=" & VBA.Left(¤é´Á, 8) & "&report_type=day&language=ch&save=csv"
- XML.Open "GET", URL, 0
- XML.send
- With stream
- .Type = 1
- .Open
- .write XML.responseBody
- If Dir(path & "¤T¤jªk¤H¶R½æ¶W" & ¤é´Á & ".csv") <> "" Then Kill (path & "¤T¤jªk¤H¶R½æ¶W" & ¤é´Á & ".csv")
- .SaveToFile (path & "¤T¤jªk¤H¶R½æ¶W" & ¤é´Á & ".csv")
- .Close
- End With
- End Sub
½Æ»s¥N½X |
|