- ©«¤l
- 6
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 8
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2017-5-20
- ³Ì«áµn¿ý
- 2017-10-31
|
¦^´_ 3# go2hk
«á¨Ó¦bºô¤W§ä¨ìµª®×¡Aµ{¦¡½X¦p¤U½Ð°Ñ¦Ò
µ{¦¡½X2.zip (614 Bytes)
Sub testname()
stock_name = "hnp"
downprice (stock_name)
End Sub
Function downprice(stock_name)
'¤U¸üÀÉ®×
Filename = Application.ActiveWorkbook.Name
Dim myURL As String
myURL = "yahoo financeºô§}, Åv¤£¨¬½Ð°Ñ¦Òµ{¦¡½X"
Dim WinHttpReq As Object
Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
WinHttpReq.Open "GET", myURL, False
WinHttpReq.send
myURL = WinHttpReq.responseBody
If WinHttpReq.Status = 200 Then
Set oStream = CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = 1
oStream.Write WinHttpReq.responseBody
oStream.SaveToFile ("D:\" & stock_name & ".csv")
oStream.Close
End If
End Function |
|