0
我得到這個錯誤「對象iwebbrowser2失敗的方法文件」..請看下面的代碼。對象iwebbrowser2失敗的方法文件
Sub getIE()
Dim sh As Object, oWin As Object, IE As Object
Set sh = CreateObject("Shell.Application")
For Each oWin In sh.Windows
If TypeName(oWin.document) = "HTMLDocument" Then
Set IE = oWin
Exit For
End If
Next
MsgBox IE.document.URL
End Sub
檢查您的所有Internet Explorer(或Chrome)窗口是否關閉 –