ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] CreateObject("MSXML2.XMLHTTP.3.0") µLªk§ì¨ú³Ì·s¸ê®Æ?

[µo°Ý] CreateObject("MSXML2.XMLHTTP.3.0") µLªk§ì¨ú³Ì·s¸ê®Æ?

¦p¤Uµ{¦¡½X:¬°¦óºô¯¸¸ê®Æ§ó·s¤F
¦ýÂ^¨ú¥X¨Óªºµ²ªG«o¤£·|¦Û°Ê§ó·s©O
¤Q¤ÀÄÁ«á¦A°õ¦æ¤@¦¸ÁÙ¬O¸ò²Ä¤@¦¸°õ¦æªºµ²ªG¬Û¦P
½Ð°Ý­n¦p¦ó§ó·s?
  1. Sub test()
  2. Set hq = CreateObject("MSXML2.XMLHTTP.3.0")
  3. hq.Open "get", "http://rate.bot.com.tw/xrt/flcsv/0/day", False
  4. hq.send
  5. MsgBox hq.responsetext
  6. End Sub
½Æ»s¥N½X
PKKO

"http://rate.bot.com.tw/xrt/flcsv/0/day"  ........ maybe

TOP

¦^´_ 1# PKKO
  1. Option Explicit
  2. Sub Ex()
  3. Dim hq As Variant, i As Integer, ii As Integer
  4. Set hq = CreateObject("MSXML2.XMLHTTP.3.0")
  5. hq.Open "get", "http://rate.bot.com.tw/xrt/flcsv/0/day", False
  6. hq.send
  7. '**Split ¨ç¼Æ ¶Ç¦^¤@­Ó³¯¦C¯Á¤Þ±q¹s¶}©lªº¤@ºû°}¦C¡A¥¦¥]§t«ü©w¼Æ¥Øªº¤l¦r¦ê¡C
  8. '**»yªk  Split(expression[, delimiter[, limit[, compare]]])
  9. hq = Split(hq.responsetext, vbCrLf)
  10. '**vbCrLf -> Chr(13) + Chr(10) = µ²¦X´«¦æ¦r¤¸»P´_¦ì¦r¤¸¡C
  11. ActiveSheet.Cells.Clear '**§@¥Î¤¤¤u§@­¶ªº©Ò¦³Àx¦s®æ,²M°£¤å¦r¤Î¨ä®æ¦¡
  12. '***Ū¨ú¸ê®Æ
  13. For i = 0 To UBound(hq)
  14.     For ii = 0 To UBound(Split(hq(i), ","))
  15.     ActiveSheet.Range("a1").Offset(i, ii) = Split(hq(i), ",")(ii)
  16.     Next
  17. Next
  18. '**Ū¨ú¸ê®Æ§¹²¦
  19. MsgBox Join(hq, vbCrLf)
  20. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 3# GBKEE


    ·PÁ¶Wª©¤j¤j,¤p§Ì«ôŪ¤@¤U
PKKO

TOP

¦^´_ 3# GBKEE


   ¦n¹³ ÁÙ¬O¨SÅÜ©ã

TOP

´«¦U¼gªk  
¥i refresh ¤F

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2017-3-3 10:57 ½s¿è

¦^´_ 5# jackyq

¶×²v¨S¦³®É®É¦bÅܧó
ªþÀÉ¥iÆ[¹î¬Ý¬Ý

¶×²v§ó·s.rar (14.74 KB)
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 6# jackyq


    ¦p¦ó´«­Ó¼gªk¥iÅܧó?
¦]¬°§Ú¥Î­ì¥»ªº¤èªk®M¥Î¤£¦Pªººô¯¸¸ê®Æ
½T¹ê¤£·|§ó·s,¹q¸£­«¶}¤~·|§ó·s¤£ª¾¹D¬°¦ó
PKKO

TOP

¦^´_ 7# GBKEE


    ·PÁ¶Wª©¤j¤j,­ì¨Ó¦Û°Ê§ó·s¥i¥H³o¼Ë¨Ï¥Î
§Ú¤@ª½³£¬O¥u·|¥Î¤U¦C¤è¦¡¦Û°Ê¦h¤[°õ¦æ¤@¦¸
  1. ts2 = Now + TimeValue("00:05:00")
  2. '°õ¦æ§¹²¦«á³]©w5¤ÀÄÁ¹L«á¦A¦¸°õ¦æ¥»µ{¦¡
  3. Application.OnTime ts2, "control_time2"
½Æ»s¥N½X
±zªº¤è¦¡Â²³æ¦h¤F
°t¦XSHEETÅܰʤ@°_·f°tµ{¦¡½X§Y¥i
PKKO

TOP

¦^´_ 6# jackyq


½Ð°Ý¤j¤j±z¬O¦p¦ó´«­Ó¼gªk´N¥i¥H§ó·s¤F©O?
§Ú´ú¸ÕÁÙ¬OµLªk§ó·s­C
¥²¶·­nÀÉ®×­«·s¥´¶}¤~·|§ó·s~
PKKO

TOP

        ÀR«ä¦Û¦b : «H¤ß¡B¼Ý¤O¡B«i®ð¤TªÌ¨ã³Æ¡A«h¤Ñ¤U¨S¦³°µ¤£¦¨ªº¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD