[µo°Ý]VBA§ì¨ú.PHP¶°ÝÃD??
- ©«¤l
- 48
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 60
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-8-13
- ³Ì«áµn¿ý
- 2023-2-7
|
¦^´_ 19# gto1208
¦pªG±z¬O°Ý#12ªºSub WrittenByLalalada()¡Aª½±µ½Æ»s¨ì±zªº¥¨¶°¥h°õ¦æ¡A´N·|¸õ¥X¤@Óµøµ¡¸ß°Ý¬d¸ßªÑ²¼¥N¸¹¡Aª½±µ¿é¤J´N¦n¤F¡C |
|
«Ü©êºp¡A§Ú¬O¤p¾Ç¥Í¡A¤£¯à¤U¸üÀɮסA¬OÓ¤p§¾«Ä¡I
|
|
|
|
|
- ©«¤l
- 11
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 14
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2011-9-17
- ³Ì«áµn¿ý
- 2017-4-24
|
heavenweaver±z¦n¡A
§Ú¤w¦³½Æ»s#12ªºSub WrittenByLalalada()¨Óקï
http://www.gretai.org.tw/ch/stock/statstics/monthly/download_st44.php
¤W¦Cºô§}¦³¤GӰѼơA¤w±Nµ{¦¡§ï¼g¦p¤U¡A¦ý¦~«×ªºsend±ø¥óÁÙ¬O§ì¨ú¤£¨ì(µ{¦¡½X¦p¤U)¡AÁÂÁ±z- Private Sub CommandButton1_Click()
- '«Å§iÅܼÆ
- Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
- Dim TMP As Workbook
- '²M°£Â¸ê®Æ
- Range("A4:Z2000").Select
- Selection.Clear
- code = Range("A1").Value 'ªÑ²¼¥N½X
- yy = Range("B1").Value '¦~«×
- '±N¸ê®Æ¥ý¦s¦ÜcÁV
- With WinHttpReq
- '.Open "POST", "http://www.gretai.org.tw/ch/stock/statistics/monthly/download_st44.php", False
- .Open "POST", Range("C1").Value, False
- .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
- .Send ("stk_no=" & code & "yy=" & yy)
- Set oStream = CreateObject("ADODB.Stream")
- oStream.Open
- oStream.Type = 1
- oStream.Write WinHttpReq.ResponseBody
- oStream.SaveToFile ("C:\" & code & ".csv")
- oStream.Close
- End With
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 48
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 60
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-8-13
- ³Ì«áµn¿ý
- 2023-2-7
|
¦^´_ 22# gto1208
½Ð°Ñ¦Ò¦Û¦æקï¡C- Sub Macro1()
- '
- ' Macro1 Macro
- ' Lu ¦b 2003/2/28 ¿ý»sªº¥¨¶°
- '
- ' §Ö³tÁä: Ctrl+a
- '
- Dim yy, stock
- yy = Application.InputBox(prompt:="½Ð¿é¤J¬d¸ß¦~¥÷(¦p2013)¡G", Title:="¤WÂd²Îp³øªí > ӪѤ릨¥æ¸ê°T")
- stock = Application.InputBox(prompt:="½Ð¿é¤JªÑ²¼¥N½X(¦p3260)¡G", Title:="¤WÂd²Îp³øªí > ӪѤ릨¥æ¸ê°T")
- If yy = "" Then yy = "2013"
- If stock = "" Then stock = "3260"
- fileIdx = "C:\MyStock\Test\st44_" & stock & ".csv"
- myURL = "http://www.gretai.org.tw/ch/stock/statistics/monthly/download_st44.php"
- myPar = "yy=" & yy & "&stk_no=" & stock
- Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
- With WinHttpReq
- .Open "POST", myURL, False
- .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
- .Send myPar
- myURL = .ResponseBody
- Set oStream = CreateObject("ADODB.Stream")
- oStream.Open
- oStream.Type = 1
- If WinHttpReq.ResponseText = "" Then Exit Sub
- oStream.Write WinHttpReq.ResponseBody
- On Error Resume Next
- Kill fileIdx
- On Error GoTo 0
- oStream.SaveToFile fileIdx
- oStream.Close
- End With
- End Sub
½Æ»s¥N½X |
|
«Ü©êºp¡A§Ú¬O¤p¾Ç¥Í¡A¤£¯à¤U¸üÀɮסA¬OÓ¤p§¾«Ä¡I
|
|
|
|
|
- ©«¤l
- 48
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 60
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-8-13
- ³Ì«áµn¿ý
- 2023-2-7
|
¦^´_ 22# gto1208
°ÝÃD¦b³o¸Ì
'±N¸ê®Æ¥ý¦s¦ÜcÁV
With WinHttpReq
'.Open "POST", "http://www.gretai.org.tw/ch/stock/statistics/monthly/download_st44.php", False
±z±N³o¬q«ü¥OÅܦ¨remark¡A¥¿½T¦p¤U¡G
.Open "POST", "http://www.gretai.org.tw/ch/stock/statistics/monthly/download_st44.php", False |
|
«Ü©êºp¡A§Ú¬O¤p¾Ç¥Í¡A¤£¯à¤U¸üÀɮסA¬OÓ¤p§¾«Ä¡I
|
|
|
|
|
- ©«¤l
- 11
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 14
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2011-9-17
- ³Ì«áµn¿ý
- 2017-4-24
|
heavenweaver±z¦n¡A
·Q¦V±z½Ð±Ð¡A¥ý«eª©¥»¨Ì·Ó±zªº«ü¾É¤w¥i¥¿±`¨Ï¥Î¡A¦ý¤µ¤é¾Þ§@®É¡Aµo²{excel¸ê®Æ¸ü¤£¤U¨Ó¡A¬O§_¬ÛÃö°Ñ¼Ænקï©O? ÁÂÁ±z¡C- Private Sub CommandButton4_Click()
- '«Å§iÅܼÆ
- Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
- Dim TMP As Workbook
- '²M°£Â¸ê®Æ
- Range("F66:Z200").Select
- Selection.Clear
- code = Range("A1").Value 'ªÑ²¼¥N½X
- yy = Range("H4").Value '¦~«×
- '±N¸ê®Æ¥ý¦s¦ÜcÁV
- With WinHttpReq
- .Open "POST", "http://www.gretai.org.tw/ch/stock/statistics/monthly/download_st44.php", False
- .Open "POST", Range("I4").Value, False
- .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
- .Send "stk_no=" & code & "&yy=" & yy '¶ÇªÑ²¼¥N½X¡B¦~«×°Ñ¼Æ
- Set oStream = CreateObject("ADODB.Stream")
- oStream.Open
- oStream.Type = 1
- oStream.Write WinHttpReq.ResponseBody
- oStream.SaveToFile ("C:\" & code & "-M.csv")
- oStream.Close
- End With
-
- End Sub
-
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 11
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 14
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2011-9-17
- ³Ì«áµn¿ý
- 2017-4-24
|
heavenweaver±z¦n¡A
¨Ï¥ÎFiddler¤u¨ãµo²{ºô§}¦³²§°Ê¡A¤w§ä¨ì°ÝÃD¤F¡AÁÂÁ±z |
|
|
|
|
|
|