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

¤U¸ü´Á³f¸ê®Æ¦Ü¤u§@ªí QueryTable¥X¿ù

¦^´_ 2# GBKEE
GBKEE ª©¤j¡A³\¤[¥¼¤©½Ð±Ð¡C
·í§Ú¨Ï¥Î With New InternetExplorer
¦b°õ¦æ®É·|²£¥Í ---
" ½sĶ¿ù»~¡G¨Ï¥ÎªÌ¦Û­q«¬ºA©|¥¼©w¸q "
¬O§_§Ú¦b³]©w¤Þ¥Î¶µ¥Ø¤¤¤Ö¥[¤J¤F­þ¤@¶µ¡H

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2015-6-2 17:11 ½s¿è

¦^´_ 1# cat9350621
WebAddress ¨Sµ¹
WebAddress = "http://www.taifex.com.tw/chinese/3/3_1_1.asp"  ´N¨S¦³¿ù»~
¦ý¤£¶Ç¦^«ü©wªº«´¬ù

¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub text()
  3.   Dim myItems As Object, myItem As Object
  4.   With New InternetExplorer
  5.     .Visible = True
  6.     .Navigate "http://www.taifex.com.tw/chinese/3/3_1_1.asp"
  7.     Do Until .readyState = READYSTATE_COMPLETE:     Loop
  8.     With .Document.myform
  9.         .COMMODITY_IDt.Value = "T5F"                 '³]©w«´¬ù
  10.     End With
  11.     Set myItems = .Document.getElementsByTagName("Input")
  12.     For Each myItem In myItems
  13.         If myItem.Value = "°e¥X¬d¸ß" Then
  14.             myItem.Click                              '«ö¤U°e¥X¬d¸ß«ö¶s
  15.         End If
  16.     Next
  17.     Do Until .readyState = READYSTATE_COMPLETE: DoEvents: Loop
  18.     Application.Wait Now + #12:00:01 AM#
  19.    
  20.     Set myItems = .Document.getElementsByTagName("table")
  21.     .Document.body.innerHTML = myItems(2).outerHTML
  22.         .ExecWB 17, 2       '  Select All
  23.         .ExecWB 12, 2       '  Copy selection
  24.         .Quit
  25.     End With
  26.     With Worksheets("Á{®É¸ê®Æ2")
  27.         .Cells.Clear
  28.         .Range("A1").Select
  29.         .PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
  30.     End With
  31. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¤f»¡¦n¸Ü¡B¤ß·Q¦n·N¡B¨­¦æ¦n¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD