Run-time error '429': ActiveX component can't create object
当我尝试运行以下代码时出现错误。
Option Explicit
Private Sub EarlyVsLateBinding()
' References to both the Microsoft Scripting Runtime and Microsoft XML, v6.0
' are active so that early binding is possible
Dim EarlyDictionary As Scripting.Dictionary
Dim LateDictionary As Object
Set LateDictionary = CreateObject("Scripting.Dictionary")
Dim EarlyHTTP As New MSXML2.XMLHTTP60
Dim LateHTTP As Object
Set LateHTTP = CreateObject("MSXML2.XMLHTTP60") ' Error is thrown here
End Sub
我已经包含了这个例子Scripting.Dictionary
来说服自己这个CreateObject
函数没有引起任何问题,并表明一个早期和晚期绑定适用于另一个类。
可悲的是,我遇到的这个类的每个示例都使用早期绑定方法,但我需要此代码的后期绑定方法。此外,将行替换为Set LateHTTP = CreateObject("MSXML2.XMLHTTP60")
产生Set LateHTTP = GetObject(Class:="MSXML2.XMLHTTP60")
相同的错误。
什么可能导致此错误?