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

½Ð°Ý¦p¦ó¥Î MSXML2.XMLHTTP ®» »OÆWÃÒ¨é¥æ©ö©Ò ­ÓªÑ¤ë¦¨¥æ¸ê°T

¦^´_ 1# wufonna
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex¤U¸üCSV()
  3.     Dim xml As Object
  4.     Dim stream
  5.     Dim URL As String     '¥Øªººô§}
  6.     Set xml = CreateObject("Microsoft.XMLHTTP") '¥Î¨Ó¨ú±oºô­¶¸ê®Æ
  7.     Set stream = CreateObject("ADODB.stream")   'ADODB.stream   '¥Î¨ÓÀx¦s¤G¶i¦ìÀÉ®×
  8.     URL = "http://www.twse.com.tw/ch/trading/exchange/STOCK_DAY/STOCK_DAY_print.php?genpage=genpage/Report201408/201408_F3_1_8_2485.php&type=csv"
  9.     xml.Open "get", URL, 0
  10.     xml.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  11.     xml.send
  12.     With stream
  13.         .Open
  14.         .Type = 1
  15.         .write xml.ResponseBody
  16.         'SaveToFile:ÀɮצWºÙ¤w¦s¦b®É·|¦³¿ù»~,¶·¥ý§R°£¤w¦s¦bªºÀɮצWºÙ
  17.         If Dir("D:\2485.CSV") <> "" Then Kill "D:\2485.CSV"
  18.         .SaveToFile ("D:\2485.CSV")
  19.         .Close
  20.     End With
  21. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¦³¦h¤Ö¤O¶q´N°µ¦h¤Ö¨Æ¡A¤£­n¤ß¦sµ¥«Ý¡Aµ¥«Ý¤~·|¸¨ªÅ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD