声明早期绑定的MSXML对象会在VBA中引发错误 [英] Declaring early bound MSXML object throws an error in VBA

查看:111
本文介绍了声明早期绑定的MSXML对象会在VBA中引发错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将xml数据导入到Excel中. 因此,代码的第一行是

I am trying to import xml data into excel.. So the first line of the code is

Dim XMLDOC As MSXML2.DOMDocument

这会导致错误未定义用户定义的类型"

and this gives an error "user defined type not defined"

推荐答案

在VBE中,转到工具"->引用",然后选择"Microsoft XML,v6.0"(或最新版本).这将使您能够访问XML对象库.

Inside the VBE, Go to Tools -> References, then Select Microsoft XML, v6.0 (or whatever your latest is. This will give you access to the XML Object Library.

已更新为精美图片!

这篇关于声明早期绑定的MSXML对象会在VBA中引发错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆