- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
        
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-9-24 20:34 ½s¿è
¦^´_ 8# spermbank
¦Û¤v´ú¸Õ¬Ý¬Ý- Sub «ö¶s3_Click()
- Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
- With ThisWorkbook.Sheets("Sheet1")
- .Range("H" & 11).Formula = "§ó·s¤¤..."
- ii = .Cells(6, 6) - 1 '°_©l¤ë
- j = .Cells(7, 6) '°_©l¤é
- k = .Cells(5, 6) '°_©l¦~
- m = .Cells(6, 8) - 1 '²×¤î¤ë
- n = .Cells(7, 8) '²×¤î¤é
- o = .Cells(5, 8) '²×¤î¦~
- h = .Cells(9, 6) '¦sÀɦì¸m
- For i = 2 To Application.CountA(.Range("A:A")) 'Äæ¦ì¦³È½d³òpºâ
- symbol = .Cells(i, 1)
- save_file_name = h & symbol & ".csv" '¦sÀÉÀɦW
- If .Range("C" & i).Formula = "¥«" Then
- '¥Îexcel¨Ó¦sÀÉ
- myURL = "http://ichart.finance.yahoo.com/table.csv?s=" & symbol & ".TW&a=" & ii & "&b=" & j & "&c=" & k & "&d=" & m & "&e=" & n & "&f=" & o & "&g=d&ignore=.csv"
- Else
- myURL = "http://ichart.finance.yahoo.com/table.csv?s=" & symbol & ".TWO&a=" & ii & "&b=" & j & "&c=" & k & "&d=" & m & "&e=" & n & "&f=" & o & "&g=d&ignore=.csv"
- End If
- WinHttpReq.Open "GET", myURL, False
- WinHttpReq.Send '
- myURL = WinHttpReq.ResponseBody
- If WinHttpReq.Status = 200 Then
- With CreateObject("ADODB.Stream")
- .Open
- .Type = 1
- .Write WinHttpReq.ResponseBody
- .SaveToFile (save_file_name)
- .Close
- End With
- End If
- Next
- .Range("H" & 11).Formula = "§ó·sµ²§ô"
- End With
- End Sub
½Æ»s¥N½X |
|