返回列表 上一主題 發帖

[發問] ie8正常但ie11無法執行

[發問] ie8正常但ie11無法執行

請問為何以下兩段不同程式碼在 ie8 均可正常執行,但 ie11 卻無反應(反紅處),是否因為程式寫法不同或需要加入什麼物件呢?

Sub test()
Dim p As Object
Set myIE = CreateObject("InternetExplorer.Application")
With myIE
  .Visible = True
  .Navigate "http://test/Default.aspx" '公司內網故無法提供真實網址

  Do While Busy Or .ReadyState <> 4: DoEvents: Loop

  Set p = .Document.all.tags("INPUT")
  .Document.all.txtUsername.innerText = "test"
  .Document.all.txtPassword.innerText = "test"
  .Document.all.ImageButton2.Click


  Do While Busy Or .ReadyState <> 4: DoEvents: Loop

End With
End Sub
--------------------------------------------------------------------------
Sub test()

Set myIE = CreateObject("InternetExplorer.Application")
With myIE
  .Visible = True
  .Navigate "http://test/Report_OMS/Reprt_Sale.aspx" '公司內網故無法提供真實網址

  Do While Busy Or .ReadyState <> 4: DoEvents: Loop

  .Document.all("ReportViewer1_ctl01_ctl05_ctl00").Value = "Excel"

End With
End Sub
*宅女一枚無誤*

        靜思自在 : 【停滯不前,終無所得】人都迷於尋找奇蹟,因而停滯不前;縱使時間再多、路再長,也了無用處,終無所得。
返回列表 上一主題