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

½Ð°Ý³o­Óºô­¶¦p¦ó¥ÎWEB¬d¸ß¿é¤Jexcel

¦^´_ 47# ML089
¥H¤W¹Ï¸ÑÁA¸Ñ§_¡H

TOP

¦^´_ 45# joey0415
°Ñ¦Ò¡G
  1. Sub ¹d¨Éºô()
  2.     Dim URL As String, shts As Worksheet
  3.     Dim x As Variant, xi As Integer
  4.    
  5.     Set shts = Sheets("¤u§@ªí2")
  6.     URL = "http://www.cnyes.com/twstock/Institutional/1101.htm"
  7.    
  8.     With CreateObject("InternetExplorer.Application")
  9.         .Visible = True     '  ¬O§_Åã¥Ü IE
  10.         .Navigate URL
  11.         
  12.         shts.Cells.Clear
  13.         For xi = 1 To 6
  14.             Do While .readyState <> 4 Or .Busy
  15.                 DoEvents
  16.             Loop
  17.             
  18.             For Each x In .document.getElementsBytagname("input")
  19.                 If x.Value = "¬d¸ß" Then x.Click: Exit For
  20.             Next
  21.             
  22.             .document.body.innerHTML = .document.getElementsBytagname("table")(xi).outerHTML
  23.             .execwb 17, 2       '  Select All
  24.             .execwb 12, 2       '  Copy selection
  25.             
  26.             With shts
  27.                 .Range("A" & .[A65535].End(xlUp).Row + 1).Select
  28.                 .PasteSpecial Format:="HTML"
  29.             End With
  30.         Next xi
  31.         shts.Cells.EntireColumn.AutoFit     '  ¦Û°Ê½Õ¾ãÄæ¼e
  32.         
  33.         .Quit
  34.     End With
  35. End Sub
½Æ»s¥N½X

TOP

¦^´_ 51# c_c_lai

ÂI¶i¥h¤~¤§§O¦³¬}¤Ñ

·PÁÂ! ¹Ï¸Ñ»¡©ú§@ªº¯u¥Î¤ß
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 45# joey0415
  1. Busy = True            
  2. Busy = False

  3. READYSTATE_UNINITIALIZED = 0
  4. READYSTATE_LOADING = 1
  5. READYSTATE_LOADED = 2
  6. READYSTATE_INTERACTIVE = 3
  7. READYSTATE_COMPLETE = 4
½Æ»s¥N½X
¤£·Q¦ACREAT¥t¤@­ÓIE : 52# c_c_lai ¤w¼g¥X¤F
¦^´_ 52# c_c_lai
¦b2003¦³¿ù»~­×¥¿¦p¤U
  1. Option Explicit
  2. Sub ¹d¨Éºô()
  3.     Dim URL As String, shts As Worksheet
  4.     Dim x As Variant, xi As Integer, A As Object, xlHtm
  5.     Set shts = ActiveSheet '  '("¤u§@ªí2")
  6.     shts.Cells.Clear
  7.     URL = "http://www.cnyes.com/twstock/Institutional/1101.htm"
  8.     With CreateObject("InternetExplorer.Application")
  9.         .Visible = True     '  ¬O§_Åã¥Ü IE
  10.         .Navigate URL
  11.          Do While .ReadyState <> 4 Or .Busy
  12.                 DoEvents
  13.             Loop
  14.         For Each x In .Document.getElementsBytagname("input")
  15.             If x.Value = "¬d¸ß" Then x.Click: Exit For
  16.         Next
  17.         Do While .ReadyState <> 4 Or .Busy: DoEvents: Loop
  18.         xlHtm = .Document.body.innerHTML                'Àx¦s
  19.         Set A = .Document.getElementsBytagname("table")
  20.         For xi = 1 To 6
  21.             .Document.body.innerHTML = A(xi).outerHTML
  22.             .ExecWB 17, 2       '  Select All
  23.             .ExecWB 12, 2       '  Copy selection
  24.             With shts
  25.                 .Range("A" & .[A65535].End(xlUp).Row + 1).Select
  26.                 .PasteSpecial Format:="HTML"
  27.             End With
  28.             .Document.body.innerHTML = xlHtm                  'ÁÙ­ì
  29.         Next xi
  30.         shts.Cells.EntireColumn.AutoFit     '  ¦Û°Ê½Õ¾ãÄæ¼e
  31.         .Quit
  32.     End With
  33. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 54# GBKEE
­ì¥»§Ú¥ç¬O¦p±z©Ò¼gªº (For ~ Next) ¤è¦¡³B­ù¡A¦ý¥¦¦b 2010 ª©¤j¬ù¦b²Ä¤G°j°é«K·|¥X²{
¿ù»~°T®§¡A©Ò¥H¥u¯à±N For ©¹¤WÂ\©ñ¡A¨C¦¸³£¦A°õ¦æ Click ªº°Ê§@¡A¤@¤Á«K¶¶¤ß¤F¡C
¬Ý¼Ë¤l´N¹³²Î­p¹Ïªíø»s¦³¨Ç»yªk³B²z¤§¾A¥Î°ÝÃD¤@¼Ë¡A¥u¯à¨Ìª©¥»¨£¾÷¦æ¨Æ¡A
ÁÂÁ±z¡I

TOP

¦^´_ 55# c_c_lai
§Ú 54# ­×¥¿ªºµ{¦¡½X2010¤£¥i¥Î?
2010½Ð¸Õ¸Õ¬Ý³oµ{¦¡½X
  1. Option Explicit
  2. Sub ¹d¨Éºô()
  3.     Dim URL As String, shts As Worksheet, ie As Object
  4.     Dim x As Variant, A As Object
  5.     Set ie = CreateObject("InternetExplorer.Application")
  6.     ie.Navigate "about:Tabs"
  7.     ie.Visible = True
  8.     Set shts = ActiveSheet '  '("¤u§@ªí2")
  9.     shts.Cells.Clear
  10.     URL = "http://www.cnyes.com/twstock/Institutional/1101.htm"
  11.     With CreateObject("InternetExplorer.Application")
  12.         .Visible = True     '  ¬O§_Åã¥Ü IE
  13.         .Navigate URL
  14.         Do While .ReadyState <> 4 Or .Busy: DoEvents: Loop
  15.         For Each x In .Document.getElementsBytagname("input")
  16.             If x.Value = "¬d¸ß" Then x.Click: Exit For
  17.         Next
  18.         Do While .ReadyState <> 4 Or .Busy: DoEvents: Loop
  19.         Set A = .Document.getElementsBytagname("table")
  20.         For x = 1 To 6
  21.             With ie
  22.             .Document.body.innerHTML = A(x).outerHTML
  23.             .ExecWB 17, 2       '  Select All
  24.             .ExecWB 12, 2       '  Copy selection
  25.             End With
  26.             With shts
  27.                 .Range("A" & .[A65535].End(xlUp).Row + 1).Select
  28.                 .PasteSpecial Format:="HTML"
  29.             End With
  30.         Next
  31.         shts.Cells.EntireColumn.AutoFit     '  ¦Û°Ê½Õ¾ãÄæ¼e
  32.         .Quit
  33.     End With
  34.     ie.Quit
  35. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 56# GBKEE
¥u¦³¤@¥y¸Ü¯à§Î®e    ----    Perfect!

TOP

¦^´_ 56# GBKEE
¦pªG§â Set ie ¥H¤Î ie.Quit §ï¦¨µùÄÀ¡A«h·|µo¥Í¦p¹Ï¤§¿ù»~¡G

TOP

¦^´_ 56# GBKEE
ªþ¤W 54# ªºµ{¦¡°õ¦æµ²ªG¡G

TOP

¦^´_ 58# c_c_lai
¦pªG§â Set ie ¥H¤Î ie.Quit §ï¦¨µùÄÀ¡A«h·|µo¥Í¦p¹Ï¤§¿ù»~¡G ¿ù»~¦æ¬O­þ¤@¦æ?
µùÄÀ«áieÅܼƴN¨S¦³«ü©wª«¥ó,¦A¨Ï¥Î¨ìie·íµM·|¿ù»~.
¦^´_ 59# c_c_lai
¹Ï¤¤ »P54# ªºµ{¦¡½X¦³ÂI¤£¼Ë,©ú¤Ñ¦A¬Ý¬Ý
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : §g¤l¥ß«í§Ó¡A¤p¤H«í¥ß§Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD