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

[µo°Ý] ¤W¥«­ÓªÑ¤é¦¨¥æ¸ê°T¤U¸ü§ïª©«Øij

[µo°Ý] ¤W¥«­ÓªÑ¤é¦¨¥æ¸ê°T¤U¸ü§ïª©«Øij

­ì¥ý°Ñ¦Ò¯¸¤W¸ê®Æ¨Ï¥Îmsxml2.xmlhttp¼g¤F¤U¸ü¤W¥«ªÑ²¼¤é¦¨¥æ¸ê°Tªº¥¨¶°¡A¨S·Q¨ì¤~¥Î¨â¤Ñ¡A¤µ¤Ñ¬ðµM¤£¯à¨Ï¥Î¤F¡A­ì¨ÓTWSE¤S§ïª©¤F¡A¬d¤F¥b¤Ñmsxml2.xmlhttp¦n¹³¨S¿ìªk§ì°ÊºA²£¥Íªºªí®æ¸ê®Æ¡A·Q­×§ï¥¨¶°¡A«o¤£ª¾¸Ó¥Î¤°»ò¤è¦¡¡A¤£ª¾¬O§_¦³«Øijªº¤u¨ã¡H
ªþ¤W­ì¥ýªº¥¨¶°¨Ñ°Ñ ¤W¥«µý¨÷¤é¦¨¥æ.rar (59.21 KB) ¦Ò

TOP

½Ð°ÝJ¤j¦p¥[ÅvªÑ»ù«ü¼Æ¾ú¥v¸ê®Æ
http://www.twse.com.tw/zh/page/trading/indices/MI_5MINS_HIST.html
¸Ó¦p¦ó¤U¸ü

TOP

http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/MI_INDEX.php
¦p¦ó¥Î¥¨¶°¤@¦¸¤U¸ü¨ì¤u§@ªí ??
¥þ³¡(¤£§tÅvÃÒ, ¤ûºµÃÒ.........)

TOP

¦^´_ 3# f3202
  1. Sub ¥¨¶°1()
  2. '
  3.     Cells.Clear
  4.     sday = 20170524
  5.     surl = "http://www.twse.com.tw/indicesReport/MI_5MINS_HIST?response=html&date=" & sday
  6.     Range("A1").Select
  7.     With ActiveSheet.QueryTables.Add(Connection:="URL;" & surl, Destination:=Range("$A$1"))
  8.         .Refresh BackgroundQuery:=False
  9.     End With
  10. End Sub
½Æ»s¥N½X
½Ð¿ï¡u¦C¦L / HTML¡v¨º­¶¿ý»s

¦Û¤w¿ý»s¬Ý¬Ý¡A§R°£¤£­nªº¡A³o§¹¦¨¤F

TOP

¦^´_ 4# t8899

½Ð¿ï¡u¦C¦L / HTML¡v¨º­¶¿ý»s

¦Û¤w¿ý»s¬Ý¬Ý¡A§R°£¤£­nªº¡A³o§¹¦¨¤F
  1. Sub ¥¨¶°2()
  2.     Cells.Clear

  3.     With ActiveSheet.QueryTables.Add(Connection:="URL;http://www.twse.com.tw/exchangeReport/MI_INDEX?response=html&date=20170524&type=ALLBUT0999", Destination:=Range("$A$1"))
  4.         .Refresh BackgroundQuery:=False
  5.     End With
  6. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2017-5-24 18:29 ½s¿è
¦^´_  t8899

½Ð¿ï¡u¦C¦L / HTML¡v¨º­¶¿ý»s

¦Û¤w¿ý»s¬Ý¬Ý¡A§R°£¤£­nªº¡A³o§¹¦¨¤F
joey0415 µoªí©ó 2017-5-24 17:36

½Ð±Ð¤@¤U
³o¼Ë§ì¤U¨Ó¦³4­Óªí¡A§Ú¥u­n³Ì«á¤@­Ó  ==> 106¦~05¤ë24¤é¨C¤é¦¬½L¦æ±¡(¥þ³¡(¤£§tÅvÃÒ¡B¤ûºµÃÒ))

    With ActiveSheet.QueryTables.Add(Connection:="URL;http://www.twse.com.tw/exchangeR ... onse=html&date=20170524&type=ALLBUT0999", Destination:=Range("$A$1"))
        .Refresh BackgroundQuery:=False
    End With
¤é´Á¦p¦ó¥ÎÅܼƥN¤J(¤µ¤Ñ) ???

TOP

¦^´_ 7# t8899

³o­Ó«Ü°ò¥»¡A«e­±³£¦³½d¨Ò¤F¡A¦Û¤v¾Ç²ß

TOP

¦^´_  t8899

³o­Ó«Ü°ò¥»¡A«e­±³£¦³½d¨Ò¤F¡A¦Û¤v¾Ç²ß
joey0415 µoªí©ó 2017-5-24 19:22


¥Î Format(Date, "yyyyMMDD") ¡A»yªk°ÝÃD¡AµLªkª½±µ¥N¤J?

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2017-5-24 20:03 ½s¿è
¦^´_  t8899

³o­Ó«Ü°ò¥»¡A«e­±³£¦³½d¨Ò¤F¡A¦Û¤v¾Ç²ß
joey0415 µoªí©ó 2017-5-24 19:22

OK¤F,  ¤£¹L¡A¥u¤U¸ü³Ì«á¤@­Óªí®æ¤£·|
Sub Macro1()
    Cells.Clear

ddd = "URL;http://www.twse.com.tw/exchangeR ... onse=html&date=" & Format(Date, "yyyyMMDD") & "&type=ALLBUT0999"


    With ActiveSheet.QueryTables.Add(Connection:=ddd, Destination:=Range("$A$1"))
        .Refresh BackgroundQuery:=False
    End Wit


end sub

TOP

        ÀR«ä¦Û¦b : ¬O«D·í±Ð¨|¡AÆg¬ü§@ĵ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD