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

[µo°Ý] CreateObject("InternetExplorer.Application") °õ¦æ§¹¦³®É·|µLªk¸õ¥X??

¦^´_  t8899
¤@ª½¥X²{"ok"°T®§µøµ¡??  §A¬O¤¤¾Ç¥ÍÀ³¸Ó·|Ãö³¬³o"ok"µøµ¡.¦³°ÝÃD¸ÕµÛ¦Û¤v¸Ñ¨M,VBA¤~·|¶i¨B. ...
GBKEE µoªí©ó 2014-1-14 13:50

§Ú§ï¤F¤@¤U¡A¬O§_¸ò³o¦³Ãö??(¬õ¦â³¡¥÷)
Sub timestock()
Application.ScreenUpdating = False
    Dim i As Integer, S As Integer, K As Integer, j As Integer
    Dim Element
    With CreateObject("InternetExplorer.Application")
        '.Visible = True           '¥iÅã¥Üºô­¶
       .Navigate "http://newmis.twse.com.tw/stock/group.jsp?ex=tse&ind=TIDX#STATISTICS"
        Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
        Set Element = .document.getelementsbytagname("table")
        With Sheets("SHEET5")
         '  .Cells.Clear
          .Range("A1:F17").ClearContents  
            'For s = 0 To element.Length - 1 '¤£ª¾¦¹ºô­¶ªºtable¤º®e:½Ð¥ý¦æ´ú¸Õºô­¶ªº§¹¾ãtable¤º®e
            For S = 2 To 3                    '¤w§ä¥Xºô­¶ªºtable¤º®e¦b 0-3 ¤¤
                For i = 0 To Element(S).Rows.Length - 1
                    K = K + 1
               '  For j = 0 To Element(S).Rows(i).Cells.Length - 1   '¸ê®ÆªºÄæ¦ì¦@6¦ì
                     j=2
                         .Cells(K, j + 1) = Element(S).Rows(i).Cells(j).innerText
                    Next
            '   Next
            Next
     '       .Cells.EntireColumn.AutoFit            '¦Û°Ê½Õ¾ãÄæ¼e
      '      .Cells.EntireRow.AutoFit               '¦Û°Ê½Õ¾ã¦C°ª
        End With
       .Quit
    End With
    Set Element = Nothing
  '  MsgBox "0K"
End Sub

TOP

¦^´_  t8899
³o¤è¦V¬O¹ïªº,¦³¶i¨B
GBKEE µoªí©ó 2014-1-14 15:31

   With CreateObject("InternetExplorer.Application")
           .Navigate "http://newmis.twse.com.tw/stock/group.jsp?ex=tse&ind=TIDX#STATISTICS
  .Quit

½Ð°Ý30¬í§ì¤@¦¸¸ê®Æ, §ì§¹µL¶· quit ,¥i¥H§ï¦¨¨C¹j30¬í¦AÄ~Äò§ì¶Ü??(¤¤¶¡°µ¤@­Ó´`ÁÙ)
¤£¥Î¤@ª½°õ¦æ iexplorer.exe ¶}¶}ÃöÃö???

TOP

´`ÁÙªº½d³ò
.Navigate "http://newmis.twse.com.tw/stock/group.jsp?ex=tse&ind=TIDX#STATISTICS"
        Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
        Set Element = .document.getelementsbytagname("table")
        With Sheets("SHEET1")
           .Cells.Clear
           K = 0
            'For s = 0 To element.Length - 1 '¤£ª¾¦¹ºô­¶ªºtable¤º®e:½Ð¥ý¦æ´ú¸Õºô­¶ªº§¹¾ãtable¤º®e
            For S = 2 To 2                    '¤w§ä¥Xºô­¶ªºtable¤º®e¦b 0-3 ¤¤
                For i = 0 To Element(S).Rows.Length - 1
                    K = K + 1
               '  For j = 0 To Element(S).Rows(i).Cells.Length - 1   '¸ê®ÆªºÄæ¦ì¦@6¦ì
                  j = 2
                         .Cells(K, j + 1) = Element(S).Rows(i).Cells(j).innerText
                        
                '    Next
               Next
            Next
     '       .Cells.EntireColumn.AutoFit            '¦Û°Ê½Õ¾ãÄæ¼e
      '      .Cells.EntireRow.AutoFit               '¦Û°Ê½Õ¾ã¦C°ª
        End With

TOP

¦^´_  t8899
ThisWorkbook µ{¦¡½X
GBKEE µoªí©ó 2014-1-15 16:31

½Ð°Ý¦p¦ó°±¤î??

TOP

¦^´_  t8899
ThisWorkbook µ{¦¡½X
GBKEE µoªí©ó 2014-1-15 16:31

30¬í®É¶¡·Q¥ÑK1Àx¦s®æ¨Ó±±¨î¡A­n¦p¦ó§ï??

Dim i As Integer, S As Integer, K As Integer, j As Integer
     Dim Element
     Dim RNG
    If Sheet3.Range("K1").Value = 1 Then Set RNG = #12:01:00 AM#
    If Sheet3.Range("K1").Value = 2 Then Set RNG = #12:02:00 AM#
    If Sheet3.Range("K1").Value = 3 Then Set RNG = #12:00:30 AM#
    If Sheet3.Range("K1").Value = 4 Then Set RNG = #12:00:10 AM#

    Application.OnTime Time + RNG, "timestock"

----------------------------------------------------
#12:01:00 AM# »Ý­nª«¥ó ???

TOP

30¬í®É¶¡·Q¥ÑK1Àx¦s®æ¨Ó±±¨î¡A­n¦p¦ó§ï??

Dim i As Integer, S As Integer, K As Integer, j As Inte ...
t8899 µoªí©ó 2014-1-15 20:36

©êºp¡A¥´ÂZ.......¤w¸Ñ¨M....................
If Sheet3.Range("K1").Value = 1 Then Application.OnTime Time + #12:01:00 AM#, "timestock"
    If Sheet3.Range("K1").Value = 2 Then Application.OnTime Time + #12:02:00 AM#, "timestock"
    If Sheet3.Range("K1").Value = 3 Then Application.OnTime Time + #12:00:30 AM#, "timestock"
    If Sheet3.Range("K1").Value = 4 Then Application.OnTime Time + #12:00:10 AM#, "timestock"

TOP

¦^´_  t8899
¦¹ºô­¶ªºµ{¦¡½X
GBKEE µoªí©ó 2014-1-13 17:40


¬O§_¤Ö¤F Set Element = Nothing ³o¤@¦æ??
À³´¡¦b34©Î36¦æ«e­±??

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-2-10 14:59 ½s¿è
¦^´_  t8899
GBKEE µoªí©ó 2014-1-16 07:25


½Ð°Ý¤µ¤Ñ³s¤F¨â¤F¤p®É¥X²{¿ù»~¦b³o¤@¦æ
Do While Ie.Busy Or Ie.ReadyState <> 4: DoEvents: Loop


¦p¦ó¸Ñ¨M?
1ª½±µ¸õ¥X
2.¤£²z·|¿ù»~
¦¹¨âºØª¬ªp¡A¦U¦p¦ó³B²z?

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡µLªk¾B¾×¡j©È®É¶¡®ø³u¡Aªá¤F³\¦h¤ß¦å¡A·QºÉ¦U¦¡¤èªk­n¾B¾×®É¶¡¡Aµ²ªG¬O¡G®ö¶O¤F§ó¦h®É¶¡¡A¥B¤@µL©Ò¦¨¡I
ªð¦^¦Cªí ¤W¤@¥DÃD