- ©«¤l
- 24
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 55
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Moon
- µù¥U®É¶¡
- 2012-2-10
- ³Ì«áµn¿ý
- 2023-10-17
|
¦^´_ 2# joey0415
J¤j,
½Ð´£ÂI¤p§Ì! ¥i¥H¤U¸ü,«oµo²{¤U¸üªº³£¬O¨S¦³¥æ©ö¸ê®Æªº *.csvÀÉ ,¬O°Ñ¼Æ¦³þ¸Ì¤£¦P¤F??
·P¿E¤£ºÉ~~~~
Sub ¤U¸ü¥æ©ö©ú²Ó(FilePath As String, stockid As String, saledate As String)
Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
Set objStream = CreateObject("ADODB.stream")
webdate = Replace(saledate, Year(Date), CStr(CInt(Year(Date)) - 1911))
FileName = FilePath + "\" + saledate + "_" + stockid + ".CSV"
With oXMLHTTP
.Open "POST", "http://www.gretai.org.tw/ch/stock/aftertrading/broker_trading/download_ALLCSV.php", False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.send "curstk=" & stockid & "&stk_date=" & webdate
If .readyState = 4 Then '.Status = 200
With objStream
.Type = 1 '¥H¤G¶i¦ì¤è¦¡¾Þ§@
.Open '¶}±Òª«¥ó
.Write oXMLHTTP.ResponseBody
If Dir(FileName) <> "" Then Kill FileName
.SaveToFile FileName
.Close
End With
End If
End With
Set oXMLHTTP = Nothing
Set objStream = Nothing
End Sub |
|