【发布时间】:2016-05-05 09:00:05
【问题描述】:
我在使用 CreateObject() 声明新对象时遇到问题
Sub A()
Dim x
'This works
Set x = CreateObject("Scripting.FileSystemObject")
Set x = Nothing
'This throws an error 429 "Active component cannot create object."
Set x = CreateObject("MSXML2.DOMDocument60")
Set x = Nothing
'The only way I can create object is to add the reference using GUID
Dim y As MSXML2.DOMDocument60
Set y = New MSXML2.DOMDocument60
Set y = Nothing
'This works like a charm
End Sub
我不明白为什么“脚本”有效而“MSXML2”无效。
我在 Windows 7 64 位上使用 MS Access 2010 32 位。
【问题讨论】:
标签: ms-access vba ms-access-2010 msxml