【发布时间】:2020-10-20 01:51:09
【问题描述】:
我在调用以下对象时遇到自动化错误
Set IE = CreateObject("InternetExplorer.Application")
显示错误
运行时错误“-2147467259 (80004005)” 自动化错误 未指明的错误
谁能知道为什么会发生这种情况
'从 cmets 移动代码
Sub TableExample()
Dim IE As Object
Dim doc As Object
Dim strURL As String
strURL = Range("B2").Value
Set IE = CreateObject("InternetExplorer.Application")
With IE '
.Visible = True
.navigate Range("B2").Value
Do Until .readyState = 4
DoEvents
Loop
Do While .Busy
DoEvents
Loop
Set doc = IE.document
GetAllTables doc
.Quit
End With
End Sub
【问题讨论】:
-
做了一些搜索,找到了一些相关信息。 1) 你有“启用保护模式”吗? 2) 改用
Set IE = New InternetExplorerMedium。 -
嘿,山姆,我也找到了这些想法,但所有这些都在这里失败了......
-
你以何种方式声明
IE variable? -
如果使用早期绑定会怎样?
-
@sam092 早期绑定没有帮助...