½Ð±Ð¦³ÃöADODB.STREAM©MMicrosoft.XMLHTTPªº¥Îªk
- ©«¤l
- 83
- ¥DÃD
- 17
- ºëµØ
- 0
- ¿n¤À
- 105
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-12-28
- ³Ì«áµn¿ý
- 2018-8-8
|
¦^´_ 3# GBKEE
Áª©¤j¡A¥i¬O§ÚÅv¤£°÷¡A¤£¯à¤U¸ü©O
¥t¥~¡A¥i¥H¤¶²ÐStreamªº¥Îªk¶Ü¡H¦n¹³¤£©ö²z¸Ñ..... |
|
|
|
|
|
|
- ©«¤l
- 83
- ¥DÃD
- 17
- ºëµØ
- 0
- ¿n¤À
- 105
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-12-28
- ³Ì«áµn¿ý
- 2018-8-8
|
¦^´_ 2# HSIEN6001
ÁÂÁ§Aªº«ü±Ð¡A¬Ý°_¨Ó§A¼gªºCODE¤ñ§Ú¤u¾ã¦h¤F¡C
¦ý§Ú¬Ý¨ì§A¦n¹³§â§Úªºcode¤À¦¨¤T³¡¥÷¡A²Ä¤@Ó©R¥O¬O·í¶}³oÓEXCEL FILE®É±Ò°Ê
¤§«á¦b"Microsoft.XMLHTTP"³¡¥÷Ū¨úCSV¡A¥ýÀˬdÀɮ׬O§_¦s¦b¡A¦p¦s¦b«K¥ý§R±¼¦A«Ø¥ß¤@Ó·sªº(³oÓ¤Ó¦n¤F¡A²{®É§Ú¬O¤â°Ê§R°£ªº¡AÁÂÁÂ)
µM«á¥ÎEXCEL VBA CALL ACCESS¦æMODULE¡A¹ï¶Ü¡H
¦ý·í¤¤¦³¨âÓ°ÝÃD¡A¥Ñ©óYAHOO´£¨ÑªºCSV¨S¦³ªÑ²¼½s¸¹¡A¦pªG¤£¦b¼g¤JACCESS®É¥[¤W«KµLªk½T»{³oÓRECORD¬O¨º¥uªÑ²¼
¥t¥~¡A³oÓ¼gªkÁÙ¬O»Ýn¡AŪ¨úYAHOO¸ê®Æ>Àx¦s¦¨CSV>Ū¨úCSV>¼g¤JACCESS>§R°£CSV
§Ú¤W±ªºCODE¡A¨ä¹ê¬O¥i¥H°µ¨ìªº¡A¦ý§Ú§Æ±æ·í¥Î"Microsoft.XMLHTTP"Ū¨úYAHOO¸ê®Æ®É¡A¯à°÷¤£¥ÎÀx¦s¦¨CSV¡Aª½±µ§â¸ê®Æ¼g¨ìACCESS¤¤¡A¤£¥Î¤£Â_«½Æ«Ø¥ß©M§R°£CSV(¦]¬°§Ú·|§ì¼Æ¦Ê¶¡¤½¥q¸ê®Æ)¡C |
|
|
|
|
|
|
- ©«¤l
- 219
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 243
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows10
- ³nÅ骩¥»
- Office2016
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2012-4-18
- ³Ì«áµn¿ý
- 2022-2-7
|
¦^´_ 1# ¤p«L«È
¸Õ¸Õ!
Excel VBA¡G
ThisWorkbook¶K¤W- Private Sub Workbook_Open()
- SaveCSV
- AccessModule
- Kill "D:\Sharestemp01\shareNo.csv"
- End Sub
½Æ»s¥N½X Excel Module¡G¶K¤W- Sub SaveCSV()
- Dim xml As Object
- Dim stream
- Dim URL As String
- Dim path As String
- path = "D:\Sharestemp01\"
- Set xml = CreateObject("Microsoft.XMLHTTP")
- Set stream = CreateObject("ADODB.stream")
- URL = "http://ichart.finance.yahoo.com/table.csv?s=" & "shareNo" & ".HK&a=09&b=27&c=2001&d=07&e=29&f=2012&g=d&ignore=.csv"
- xml.Open "GET", URL, 0
- xml.send
- With stream
- .Type = 1
- .Open
- .Write xml.responseBody
- If Dir(path & "shareNo" & ".csv") <> "" Then Kill (path & "shareNo" & ".csv")
- .SaveToFile (path & "shareNo" & ".csv")
- .Close
- End With
- Set stream = Nothing
- Set xml = Nothing
- End Sub
- Sub AccessModule()
- Dim A As Object
- Application.DisplayAlerts = False
- Set A = CreateObject("Access.Application")
- A.Visible = False
- A.OpenCurrentDatabase filepath:="D:\Shares\temp.mdb", Exclusive:=False, bstrPassword:=""
- A.Run "InPutData"
- Application.DisplayAlerts = True
- A.CloseCurrentDatabase
- A.Quit
- Set A = Nothing
- End Sub
½Æ»s¥N½X Temp.mdb ·s¼WModule¡G¶K¤W- Option Compare Database
- Function InPutData()
- DoCmd.SetWarnings False
- DoCmd.TransferText acImportDelim, "", "Table", "D:\Sharestemp01\shareNo.csv", True, ""
- End Function
½Æ»s¥N½X |
|
|
|
|
|
|