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

[µo°Ý] ¦p¦ó§PÂ_ Application.OnTime ¬O§_¦b°õ¦æ??

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-10-17 20:56 ½s¿è
Sub timestock()
Call  AAA ( True ) ' ©ñ¦b  Application.OnTime The_Time, "timestock" ¤§«e

my = #1 ...
bobomi µoªí©ó 2014-10-17 20:11
Book1.rar (5.72 KB)
applicaiton.ontime  ³Â·Ð¯uªº«Ü¤j
±ý°±¤î ,°õ¦æ¶¥¬q¿ù»~1004
¦p¦ó±j­¢°±¤î???Ãö±¼excel ??

TOP

¦^´_ 11# t8899


1. ¬O§_¥i¥H»¡©ú³o­Óµ{¦¡ªº¥Î·N¬°¦ó?
¡@¦p¦¹¤~¯à¯u¥¿À°§A¹F¨ì¡A§A·Q­n°l¨Dªº®ÄªG¡C

2. ¤j³¡¥÷®É¶¡¦³2ºØ§e²{¤è¦¡¡i®É¶¡­p®É¡j»P¡i­Ë¼Æ­p®É¡j¡C

3. «Øij§A¥i¥H³]¥ß2­Ó«ö¶s¡iµ{¦¡¶}©l±Ò°Ê¡j»P¡iµ{¦¡°±¤î¡j·|¤ñ¸û¦n¡C
¡@¦]¬°¦³Ãö©ó®É¶¡¡Aµ{¦¡ªº¼gªk³£¬O­n§Y®É§óªñªº¡A´N·|µo¥Í§A³oºØ¡¨µ{¦¡°±¤£¤U¨Ó¡¨ªºµ~¹Ò¡C
§Ú«Ü²Â,©Ò¥H§Ú«Ü¥Î¤ß
¡@§Ú¾ÇÃÀ¤£ºë,¦ý§Ú´÷¨Dª¾ÃÑ

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-10-18 06:22 ½s¿è
¦^´_  t8899
1. ¬O§_¥i¥H»¡©ú³o­Óµ{¦¡ªº¥Î·N¬°¦ó?
¡@¦p¦¹¤~¯à¯u¥¿À°§A¹F¨ì¡A§A·Q­n°l¨Dªº®ÄªG¡C
..
»k¥ú°j¯T µoªí©ó 2014-10-17 22:58
1. ¬O§_¥i¥H»¡©ú³o­Óµ{¦¡ªº¥Î·N¬°¦ó?
¡@¦p¦¹¤~¯à¯u¥¿À°§A¹F¨ì¡A§A·Q­n°l¨Dªº®ÄªG¡C

1¤ÀÄÁ°õ¦æ1¦¸zzzzzµ{§Ç
¦³®É²ö¦W¨ä§®??¬í¡A·|°õ¦æ1¦¸,³oºØ±¡§Î¥X²{«á¡A«ö°±¤î¶sÁÙ¦b°õ¦æ¡A¥u¯àÃö±¼excel
Sub IE345678()
If Not Ie Is Nothing Then
MsgBoxTest 0, "IE345678 ¤w°õ¦æ", "´£¥Ü°T®§", vbSystemModal, 0, 2000
Exit Sub
End If
    Set Ie = CreateObject("InternetExplorer.Application")
    Ie.Navigate "http://newmis.twse.com.tw/stock/group.jsp?ex=tse&ind=TIDX#STATISTICS"
    Do While Ie.Busy Or Ie.ReadyState <> 4: DoEvents: Loop
    timestock
End Sub
-------------------------------------------------
Sub timestock()
   my = #12:01:00 AM#
The_Time = Time + my
Application.OnTime The_Time, "timestock"
    '-------------------------------------------------------
zzzzz ' ¥D­nµ{§Ç
'------------------------------------------------------------------------------------------
        If Not Ie Is Nothing Then
        Application.OnTime The_Time, "timestock", Schedule:=False
        Ie.Quit
        Set Ie = Nothing
                 End If
Exit Sub




3. «Øij§A¥i¥H³]¥ß2­Ó«ö¶s¡iµ{¦¡¶}©l±Ò°Ê¡j»P¡iµ{¦¡°±¤î¡j·|¤ñ¸û¦n¡C
¡@¦]¬°¦³Ãö©ó®É¶¡¡Aµ{¦¡ªº¼gªk³£¬O­n§Y®É§óªñªº¡A´N·|µo¥Í§A³oºØ¡¨µ{¦¡°±¤£¤U¨Ó¡¨ªºµ~¹Ò¡C

§Ú¥»¨Ó´N¬O°µ¨â­Ó«ö§á¡A¦ý§Ú¤]¦³§â³o¨â­Óµ{§ÇÂ\¦b Private Sub Worksheet_Calculate()  ¸Ì
Private Sub Worksheet_Calculate()
  If TimeValue(Now) = TimeValue("13:24:51") Then
IE345678
End If

If TimeValue(Now) = TimeValue("13:30:30") Then
ASTOP
End If
end sub
---------------------------------------------------
Sub ASTOP()
        If Not Ie Is Nothing Then
        On Error Resume Next
           Ie.Quit
        Application.OnTime The_Time, "timestock", Schedule:=False
           MsgBoxTest 0, "¤w°±¤î ", "´£¥Ü°T®§", vbSystemModal, 0, 350
          End If
   
End Sub

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-10-18 07:18 ½s¿è

¦^´_ 13# t8899
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Dim The_Time As Date '³o¼Ò²Õªº¨p¥ÎÅܼÆ
  3. Sub timestock()
  4.     Dim my As Date
  5.     If The_Time > Time Then
  6.        Exit Sub
  7.         '¹w¨¾ ¤W¤@¦¸ OnTime©|¥¼°õ¦æ,¦A«×°õ¦æ¤@¦¸OnTime
  8.     End If
  9.     Application.StatusBar = "°õ¦æ timestock  ¤¤..."
  10.     my = #12:01:00 AM#
  11.     The_Time = Time + my
  12.     Application.OnTime The_Time, "timestock"
  13.     Application.StatusBar = "¤U¦¸°õ¦æ timestock  ®É¶¡" & The_Time
  14. End Sub
  15. Sub ASTOP()
  16.     If The_Time < Time Then
  17.         MsgBox "¨S¦³ OnTime µ{§Ç ", , "´£¥Ü°T®§"
  18.     Else
  19.         Application.OnTime The_Time, "timestock", Schedule:=False
  20.         MsgBox The_Time & " ªº OnTime µ{§Ç ¤w°±¤î", , "´£¥Ü°T®§"
  21.         Application.StatusBar = False
  22.         The_Time = 0
  23.     End If
  24. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ bobomi ©ó 2014-10-18 08:26 ½s¿è

Sub IE345678()

If Not Ie Is Nothing Then
   MsgBox "IE345678 ¤w°õ¦æ"
   Exit Sub
End If


    Set Ie = CreateObject("InternetExplorer.Application")
        Ie.Visible = 1
        Ie.Navigate "http://newmis.twse.com.tw/stock/group.jsp?ex=tse&ind=TIDX#STATISTICS"
        
    Do While Ie.Busy Or Ie.ReadyState <> 4: DoEvents: Loop
    timestock
End Sub

Sub timestock()

'Application.OnTime The_Time, "timestock"
    '-------------------------------------------------------
'zzzzz ' ¥D­nµ{§Ç
For w = 1 To 100000000
   
Next

'------------------------------------------------------------------------------------------
        If Not Ie Is Nothing Then
           Ie.Quit
           Set Ie = Nothing         
        End If
       my = 3 / 86400
       The_Time = Time + my
       Application.OnTime The_Time, "IE345678"
End Sub

TOP

­n¨D 99% ·Ç®É´N³o¼Ë

Sub IE345678()

If Not IE Is Nothing Then
   Application.OnTime The_Time + 1 / 86400, "IE345678"
   Exit Sub
End If


    Set IE = CreateObject("InternetExplorer.Application")
        IE.Visible = 1
        IE.Navigate "http://newmis.twse.com.tw/stock/group.jsp?ex=tse&ind=TIDX#STATISTICS"
        
    Do While IE.Busy Or IE.ReadyState <> 4: DoEvents: Loop
    timestock
End Sub

Sub timestock()


        my = 3  / 86400
        The_Time = Time + my
        Application.OnTime The_Time, "IE345678"

    '-------------------------------------------------------
'zzzzz ' ¥D­nµ{§Ç
For w = 1 To 100000000
   
Next

'------------------------------------------------------------------------------------------
        If Not IE Is Nothing Then
           IE.Quit
           Set IE = Nothing
        End If
End Sub

TOP

Sub IE345678()

If Not Ie Is Nothing Then
   MsgBox "IE345678 ¤w°õ¦æ"
   Exit Sub
End If
  ...
bobomi µoªí©ó 2014-10-18 08:23

­n´ú¸Õ¤@¬q®É¶¡,§Æ±æ¯à¸Ñ¨M°ÝÃD,ÁÂÁ«ü¾É .

TOP

­n¨D 99% ·Ç®É´N³o¼Ë

Sub IE345678()

If Not IE Is Nothing Then
   Application.OnTime The_Time + ...
bobomi µoªí©ó 2014-10-18 08:31


­n´ú¸Õ¤@¬q®É¶¡,§Æ±æ¯à¸Ñ¨M°ÝÃD,ÁÂÁ«ü¾É .

TOP

¦^´_  t8899
¸Õ¸Õ¬Ý
GBKEE µoªí©ó 2014-10-18 07:10


my = #12:01:00 AM#
¬O¤£¬O³o°ÝÃD ??¤W¤È¶]¨S°ÝÃD¡A¤U¤È´`ÁÙ2-3¦¸·|¸õ¥X??

TOP

¦^´_ 19# t8899
   
my = #12:01:00 AM#
¬O¤£¬O³o°ÝÃD ??¤W¤È¶]¨S°ÝÃD¡A¤U¤È´`ÁÙ2-3¦¸·|¸õ¥X??

ÅK©w¤£¬O,­nªþÀɬݬݩάO§¹¾ãµ{¦¡½X
  1. Sub Ex()
  2.     Dim A As Double
  3.     A = #12:01:00 AM#
  4.     MsgBox A = 60 / 86400
  5. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ÁÀ¨¥¹³¤@¦·²±¶}ªºÂAªá¡A¥~ªí¬üÄR¡A¥Í©Rµu¼È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD