- 帖子
- 218
- 主題
- 73
- 精華
- 0
- 積分
- 290
- 點名
- 0
- 作業系統
- WIN10
- 軟體版本
- Office2010
- 閱讀權限
- 20
- 性別
- 女
- 註冊時間
- 2014-5-19
- 最後登錄
- 2022-11-29
|
請問為何以下兩段不同程式碼在 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 |
|