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

[µo°Ý] ¶}ie¨Ã©w®É§ó·s¦¹ºô­¶

[µo°Ý] ¶}ie¨Ã©w®É§ó·s¦¹ºô­¶

¤j®a¦n

¤p§Ì·Q­n¥´¶}¤@­Óie¡A¨Ã¥B¨C3¬í§ó·s³o­Óºô­¶

¦ýºô­¶§ó·s1¦¸¥H«á
excel´N¸õ¥XµLªk°õ¦æ¥¨¶°timer ie
¸Ó¥¨¶°¥i¯àµLªk¦b¦¹¬¡­¶Ã¯¨Ï¥Î¡A©Î¤w°±¥Î©Ò¥H¥¨¶°

±À´ú¬Otimer¸Ì­±¦³¤Þ¼ÆªºÃö«Y
¦ý¨S¦³¤Þ¼Æ¡A½sĶ¾¹¤S·|»¡¨S¦³ª«¥ó

¥Îapplication.waitªº¸Ü§Ú§ó·sºô­¶¥H«áÁÙ­n½Æ»s¶K¤WEXCEL
³o®ÉEXCEL·|°±¦í¡A¤]¤£¬O§Ú­nªº

½Ð±Ð¤j®a¦³¨S¦³¤°»ò¤èªk¥i¥HÅýtimer¥¿±`¹B§@©O

µ{¦¡½X¦p¤U
  1. Sub ºô­¶§ó·s()

  2.     Dim ie As Object
  3.     Set ie = CreateObject("InternetExplorer.Application")

  4.     With ie
  5.         .Visible = True
  6.         .navigate "www.google.com.tw"
  7.          Do While .busy Or .readystate <> 4: DoEvents: Loop
  8.     End With
  9.    
  10.     timer ie
  11.    
  12. End Sub


  13. Public Sub timer(ie As Object)'¨S¦³¤Þ¥ÎIE»¡¨S¦³ª«¥ó
  14.    
  15.     With ie
  16.         .Refresh
  17.         Do While .busy Or .readystate <> 4: DoEvents: Loop
  18.     End With
  19.          
  20.     alertTime = Now + TimeValue("00:00:10")
  21.     Application.OnTime alertTime, "timer ie"'¤Þ¥Î¥H«á³o¸Ì´N¤£¦æ¤F
  22.    
  23. End Sub
½Æ»s¥N½X

¥»©«³Ì«á¥Ñ °a¤ªºµ ©ó 2021-1-27 22:23 ½s¿è

¦^´_ 1# ggrip

¦³ªÅÀ°§Ú¸Õ¸Õ¬Ý   ·PÁÂ
  1. Dim K As Boolean

  2. Public Sub §ó·sºô­¶½m²ß()

  3.     Set IE = CreateObject("internetexplorer.application")
  4.         IE.Visible = True
  5.         IE.Navigate "www.google.com.tw"
  6.         Do While IE.readyState <> 4 Or IE.Busy: DoEvents: Loop
  7.         Application.Wait Now + TimeValue("00:00:01")
  8.         Call ­p®É¾¹
  9.                  
  10. End Sub

  11. Sub ¶}©l­p®É()
  12.     Application.ScreenUpdating = False
  13.     On Error Resume Next
  14.     Application.OnTime Now + TimeValue("00:00:03"), "­p®É¾¹"
  15.    
  16.     If K = 1 Then Call Ãö³¬­p®É¾¹
  17.         Set Sh = CreateObject("Shell.Application")
  18.         For n = Sh.Windows.Count To 1 Step -1
  19.             Set IE = Sh.Windows(n - 1)
  20.             If Right(UCase(IE.FullName), 12) = "IEXPLORE.EXE" Then
  21.                 If IE.document.Url Like "*www.google.com.tw*" Then
  22.                     IE.refresh
  23.                 Exit For
  24.                 End If
  25.             End If
  26.         Next n
  27.         
  28.     On Error GoTo 0
  29.     Application.ScreenUpdating = True
  30. End Sub

  31. Sub ­p®É¾¹()
  32.     Application.ScreenUpdating = False
  33.     On Error Resume Next
  34.    
  35.         If K <> 1 Then
  36.             Call ¶}©l­p®É
  37.         Else
  38.             Application.OnTime Now + TimeValue("00:00:01"), "¶}©l­p®É", schedule:=False
  39.         End If
  40.    
  41.     On Error GoTo 0
  42.     Application.ScreenUpdating = True
  43. End Sub

  44. Sub Ãö³¬­p®É¾¹()
  45.     Application.ScreenUpdating = False
  46.     On Error Resume Next
  47.     Application.OnTime Now + TimeValue("00:00:01"), "­p®É¾¹", schedule:=False
  48.    
  49.         Set Sh = CreateObject("Shell.Application")
  50.         For n = Sh.Windows.Count To 1 Step -1
  51.             Set IE = Sh.Windows(n - 1)
  52.             If Right(UCase(IE.FullName), 12) = "IEXPLORE.EXE" Then
  53.                 If IE.document.Url Like "*www.google.com.tw*" Then
  54.                     IE.Quit
  55.                     K = 1
  56.                 Exit For
  57.                 End If
  58.             End If
  59.         Next n
  60.         
  61.     On Error GoTo 0
  62.     Application.ScreenUpdating = True
  63. End Sub
½Æ»s¥N½X
§Æ±æ¦³«e½ú­Ì¥i¥HÀ°§Úºë²¤@¤U ¦]¬°µ{¦¡½X¤Óªø¤F.....·Q¤£¥X¨Ó¦p¦óºë²...¦]¬°¤p§ÌÁÙ¦b¾Ç²ß¤¤§Æ±æ¯à°÷¦³§ó¦nªº¼gªk ¸U¤À·PÁÂ

TOP

ÁÂÁºµ¤j¡Aµ{¦¡½X¥i¥H¹B§@
­ì¨Ó¬OSHELLªºÃö«Y¡A¾Ç¨ì¤F

TOP

        ÀR«ä¦Û¦b : ¦³´¼¼z¤~¯à¤À¿ëµ½´c¨¸¥¿¡F¦³Á¾µê¤~¯à«Ø¥ß¬üº¡¤H¥Í¡C
ªð¦^¦Cªí ¤W¤@¥DÃD