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

[µo°Ý] ½Ð±Ð¦¹µ{§Ç¬°¦ó¿ù»~?

[µo°Ý] ½Ð±Ð¦¹µ{§Ç¬°¦ó¿ù»~?

½Ð±Ð¦¹µ{§Ç¬°¦ó¿ù»~? Book1.zip (11.51 KB)

Sub timestock()
' Application.EnableEvents = False
    Application.ScreenUpdating = False
If TimeValue(The_Time) > TimeValue(Time) Then    '¹w¨¾ ¤W¤@¦¸ OnTime©|¥¼°õ¦æ,¦A«×°õ¦æ¤@¦¸OnTime
     Exit Sub
End If

' Time     '**** °õ¦æªºOnTime
' The_Time '**** °õ¦æ¤U¤@¦¸OnTime

'------------------------------------------------------------------------------------------
Dim TIMEB, AG
TIMEB = 10
AG = (TimeValue(Now) * 60 * 60 * 24) - (Range("B2") * 60 * 60 * 24) '´«¬°¬í

  If AG > TIMEB Then
  On Error Resume Next
  Application.OnTime The_Time, "timestock", Schedule:=False
  If Err Then
     Application.OnTime The_Time, "timestock", Schedule:=True
  End If

      The_Time = 0
       Range("B2") = TimeValue(Now)
    MsgBox "­«¶]"
timestock
Exit Sub
End If                                                   '   333333
'--------------------------------------------------------------------------------

   
    my = #12:00:01 AM#
The_Time = Time + my
Application.OnTime The_Time, "timestock"
[a2] = [a2] + 1
Range("a1").Value = Format(The_Time, "hh:mm:ss")

End Sub

TOP

²³æªº code ½ÆÂø¤Æ

TOP

¥»©«³Ì«á¥Ñ bobomi ©ó 2015-4-4 21:43 ½s¿è

³Ì²³æªº¤èªk´N¬O "³q³q" ¤£¥Î«ü©w Schedule:=False  ´N¤£·|¦³³o­Ó°ÝÃD¤F
If AG > TIMEB Then
  Application.OnTime The_Time, "timestock"
      The_Time = 0
       Range("B2") = TimeValue(Now)
    MsgBox "­«¶]"
timestock
Exit Sub
End If

TOP

³Ì²³æªº¤èªk´N¬O "³q³q" ¤£¥Î«ü©w Schedule:=False  ´N¤£·|¦³³o­Ó°ÝÃD¤F
If AG > TIMEB Then
  Applicat ...
bobomi µoªí©ó 2015-4-4 21:41


Schedule:=False  ÁÙ¬O¨S¿ìªk²×¤î?
¤§«e¦b§Oªºµ{§Ç¤¤¤]¸g±`µo¥Í.......§ï¦¨¤½¥ÎÅܼƴN¥i¥H°±¤î,,³o¦¸´N¤£¦æ¤F
§Úªº»Ý¨D¬O¶]¤@¬q®É¶¡«á¸õ¥X¦A­«¶]¡A©Ò¥HSchedule:=False ¤@©w­n½T»{°h¥X¤~¦æ

TOP

¥»©«³Ì«á¥Ñ bobomi ©ó 2015-4-4 23:15 ½s¿è

(1) ¬°¦ó­n¶]¤@¬q®É¶¡«á¸õ¥X©O
¬O¦]¬°§Aªº Sub timestock() ÁÙ¨S­pºâ§¹®É,  Sub timestock() «o¤S²ö¦W­«·s­pºâ¤@¦¸¶Ü ?



(2)

    my = #12:00:01 AM#
The_Time = Time + my
Application.OnTime The_Time, "timestock"

[a2] = [a2] + 1    ------------>    §A³o¸Ìªº¯u¥¿­ì©l Code ¬O§_¬O¤@¬q«Ü¯Ó®Éªº­pºâ, ·|ªáÆZ¤[ªº­pºâ   ??????  
Range("a1").Value = Format(The_Time, "hh:mm:ss")

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2015-4-5 06:23 ½s¿è
(1) ¬°¦ó­n¶]¤@¬q®É¶¡«á¸õ¥X©O
¬O¦]¬°§Aªº Sub timestock() ÁÙ¨S­pºâ§¹®É,  Sub timestock() «o¤S²ö¦W­«·s ...
bobomi µoªí©ó 2015-4-4 23:10


¤W­±¬O­Ó´ú¸Õ
§Ú¬O¥Îie³s¤W¬Yºô¯¸
Set Ie = CreateObject("InternetExplorer.Application")
Ie.Navigate "http://mis.twse.com.tw/stock/group.jsp?ex=tse&ind=TIDX#STATISTICS"
5¬íºô¯¸·|¦Û°Ê§ó·s¤@¦¸¸ê®Æ¡A§Úµo²{ie °±¯d10¤À·|³y¦¨excel¾ã­Ó³t«×ºC¤U¨Ó(·Æ¹«¥X²{º|¤æª¬)¡A©Ò¥H¥²¶·¸õ¥XIE, ¦A­«¶]

>>>>[a2] = [a2] + 1    ------------>    §A³o¸Ìªº¯u¥¿­ì©l Code ¬O§_¬O¤@¬q«Ü¯Ó®Éªº­pºâ, ·|ªáÆZ¤[ªº­pºâ   ?????
§Ú§â³o¦æ®³±¼¤]¨S¥Î

TOP

Schedule:=False  ÁÙ¬O¨S¿ìªk²×¤î?
¤§«e¦b§Oªºµ{§Ç¤¤¤]¸g±`µo¥Í.......§ï¦¨¤½¥ÎÅܼƴN¥i¥H°±¤î,,³o¦¸´N¤£¦æ¤F
t8899 µoªí©ó 2015-4-4 22:30


§Aªº  Application.OnTime The_Time, "timestock", Schedule:=False ¤§©Ò¥H·|µo¥X Error Msg
¬O¦]¬°§Aªº  Application.OnTime  ¦­´N¤w¸g¦Û°Ê³Q°±¤î¤F
©Ò¥H§A¦A¦¸¹ï¥¦¤U¹F°±¤îªº©R¥O®É, ¥¦´N·|µo¥X Error Msg
¦]¬° Application.OnTime ¦^©I¶i¤J°õ¦æ "timestock" ®É , EXCEL ´N¦Û°Ê§â¥¦°±¤î¤F


'=========
[a2] = [a2] + 1   
Range("a1").Value = Format(The_Time, "hh:mm:ss")



my = #12:00:01 AM#
The_Time = Time + my
Application.OnTime The_Time, "timestock"    ' ---> §â³o­Ó©ñ¨ì sub timestock ªº³Ì«á­±¨Ó¬Ý¬Ý¯à¤£¯à¸Ñ¨M

TOP

5¬íºô¯¸·|¦Û°Ê§ó·s¤@¦¸¸ê®Æ¡A§Úµo²{ie °±¯d10¤À·|³y¦¨excel¾ã­Ó³t«×ºC¤U¨Ó(·Æ¹«¥X²{º|¤æª¬)¡A©Ò¥H¥²¶·¸õ¥XIE, ¦A­«¶]
t8899 µoªí©ó 2015-4-5 06:22



Ie.Navigate "http://mis.twse.com.tw/stock/group.jsp?ex=tse&ind=TIDX#STATISTICS"
Åý Ie.Navigate ¥u°õ¦æ1¦¸ ,  Ie.Navigate ¤£­n¥X²{¦b sub timestock  , ¦Ó¥B«O«ù IE ¥Ã»·¤£³QÃö³¬

±µ¤U¨Ó¥Î Application.Otime  ....  

Sub   timestock()

    Call Ie.Refresh2  '¥Î Ie.Refresh2  ¨ú¥N±¼ Ie.Navigate
    Do Until Ie.readyState = 4
    DoEvents
    Loop

    my = #12:00:01 AM#
    The_Time = Time + my
    Application.OnTime The_Time, "timestock"

End  Sub

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2015-4-5 13:15 ½s¿è
Ie.Navigate "http://mis.twse.com.tw/stock/group.jsp?ex=tse&ind=TIDX#STATISTICS"
Åý Ie.Naviga ...
bobomi µoªí©ó 2015-4-5 08:10


Ie.Refresh2  ³o¬Oie ªºÄÝ©Ê ??«á­±¦h¤@­Ó2 ???

  §Aªº  Application.OnTime The_Time, "timestock", Schedule:=False ¤§©Ò¥H·|µo¥X Error Msg
¬O¦]¬°§Aªº  Application.OnTime  ¦­´N¤w¸g¦Û°Ê³Q°±¤î¤F

¥¦¬O°õ¦æ¨ì¨º¤@¦æ³Q°±¤îªº??¦p¦ó½T»{¥¦¤w³Q°±¤î¤F??
---------------------------------------------------
¥t¥~½Ð±Ð¥t¤@­Ó°ÝÃDªþÀÉ Book1.zip (10.03 KB)
¦¹¨Ò Schedule:=False ¤]¬O¿ù»~¡A¤£¹L­n½Ð±Ð¥t¤@­Ó°ÝÃD
°õ¦æIE345678 «á¡A¤j¬ù17¬í·|­«·s¶](­ì¥»³]­p³o¬O¥¿±`)¡A¦ý°õ¦æ¤¤¡A¬°¦ó¤Á´«¨ìSHEET2®É·|³sÄò¤@ª½¥X²{"­«¶]"??
B2 ªº­È·í¤Á´«¨ìSHEET2 ´N§ì¤£¨ì ???(µ{§Ç¤¤¦³«ü©w¤u§@ªí)

TOP

        ÀR«ä¦Û¦b : «Î¼e¤£¦p¤ß¼e¡C
ªð¦^¦Cªí ¤W¤@¥DÃD