- ©«¤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
|
¦^´_ 1# msmplay
¦p¹ÏIE¤W²¾°Ê·Æ¹«¨ìCSV¤U¸üªº¦ì¸m,¥i¬Ý¨ìÀɮתººô§}
- Option Explicit
- Const FileName = "d:\mycsv.csv" '¦sÀɦì¸m¿ý¡A¥i¦Û¦æקï
- Const URL = "http://www.twse.com.tw/exchangeReport/STOCK_DAY?response=csv&date=20180101&stockNo=2303"
- Sub Ex_¦sÀɤ@()
- Application.DisplayAlerts = False
- With Workbooks.Open(URL)
- .SaveAs FileName
- .Close
- End With
- Application.DisplayAlerts = True
- End Sub
- Sub Ex_¦sÀɤG()
- Dim Xmlhttp As Object
- Set Xmlhttp = CreateObject("WinHttp.WinHttpRequest.5.1")
- With Xmlhttp
- .Open "POST", URL, False
- .Send
- End With
- With CreateObject("ADODB.Stream")
- .Type = 1
- .Open
- .write Xmlhttp.ResponseBody
- If Dir(FileName) <> "" Then Kill FileName '¬Û¦P¦WºÙªºÀɮצs¦b·|¦³¿ù»~
- .SaveToFile FileName
- .Close
- End With
- End Sub
½Æ»s¥N½X |
|