VBA通过DOM打开/编辑XML [英] VBA open/edit XML via DOM

查看:450
本文介绍了VBA通过DOM打开/编辑XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对编程很陌生所以要温柔!我想打开并编辑一个xml文件,该文件将成为pdf表单的数据源。
我想用来编辑xml文件的数据在MS Access中。我试图一次采取这一步,我试图通过vba代码打开和编辑一个xml文件。以下代码抛出运行时错误代码91. 我不明白为什么。  我有一个参考
到"Microsoft XML,v6.0"




I am very new to programming, so be gentle! I want to open and edit an xml file that will be the source of data for a pdf form. the data I want to use to edit the xml file is in MS Access. Trying to take this one step at a time, I am trying to open and edit an xml file via vba code. The following code throws a runtime error code 91.  I don't understand why.  I do have a reference to "Microsoft XML, v6.0"

推荐答案

你必须使用New:

You must use New:

Dim xmlDoc As New MSXML2.DOMDocument60

Dim xmlNew MSXML2.DOMDocument60

Dim xmlDoc As New MSXML2.DOMDocument60
Dim xmlNew As New MSXML2.DOMDocument60


这篇关于VBA通过DOM打开/编辑XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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