返回列表 上一主題 發帖

關於CreateObject("InternetExplorer.Application")的使用

關於CreateObject("InternetExplorer.Application")的使用

當我放在UserForm1內執行時,會執行非常久都沒反應。
  1. Private Sub CommandButton1_Click()
  2. '帳密驗證
  3.     With CreateObject("InternetExplorer.Application")
  4.         .Navigate "https://tw.yahoo.com"
  5.    
  6.         Do While .Busy Or .ReadyState <> 4
  7.             DoEvents
  8.         Loop
  9.         .Document.all("username").innerText = "A"
  10.         .Document.all("password").innerText = "B"
  11.         .Document.all("submit2").Click
  12.         .Visible = True
  13.     End With
  14.                
  15.     With CreateObject("InternetExplorer.Application")
  16.         .Navigate "https://tw.yahoo.com"
  17.    
  18.         Do While .Busy Or .ReadyState <> 4
  19.             DoEvents
  20.         Loop
  21.         .Document.all("username").innerText = "A"
  22.         .Document.all("password").innerText = "B"
  23.         .Visible = True
  24.     End With
  25. End Sub
複製代碼

回復 1# av8d


    問題已解決~重開機即可= =

TOP

        靜思自在 : 人要自愛,才能愛普天下的人。
返回列表 上一主題