Board logo

標題: [發問] ie8正常但ie11無法執行 [打印本頁]

作者: msmplay    時間: 2018-6-6 11:14     標題: 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




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)