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

[µo°Ý]VBA§ì¨ú.PHP­¶°ÝÃD??

¥»©«³Ì«á¥Ñ lalalada ©ó 2012-8-3 13:58 ½s¿è

¸ô¹L...
¶¶¤âÀ°§A¼g¤F¤@­Ó
¥»¨Ó¨º­Ó¦³ÂI¤¾ ¨S¦³»{¯u¬Ý
¤£ª¾¹D³o¬O¤£¬O§A­nªº?
¤£¹L¥H«áÁÙ¬O¦Û¤v¼g·|¤ñ¸û¦n³á:)
¨Ï¥Î»¡©ú: 1.¿é¤JªÑ²¼¥N½X 2.¥hC¼Ñ§ä¦P¦WÀÉ®×(.csv)
  1. Sub WrittenByLalalada()
  2. Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
  3. code = Application.InputBox(prompt:= "Written by lalalada", Title:="¿é¤J¥N½X:")
  4.     With WinHttpReq
  5.     .Open "POST", "http://www.gretai.org.tw/ch/stock/statistics/monthly/download_st42.php", False
  6.     .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  7.     .Send ("stk_no=" & code)
  8.            Set oStream = CreateObject("ADODB.Stream")
  9.            oStream.Open
  10.            oStream.Type = 1
  11.            oStream.Write WinHttpReq.ResponseBody
  12.            oStream.SaveToFile ("C:\" & code & ".csv")
  13.            oStream.Close
  14.     End With
  15. End Sub
½Æ»s¥N½X
³Ñ¤Uªº¥\¯à´N¦Û¤v§ïÅo!

TOP

        ÀR«ä¦Û¦b : §g¤l¥ß«í§Ó¡A¤p¤H«í¥ß§Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD