根据Excel 2007中的用户选择从XML文件中检索记录 [英] Retrieving records from XML file based on User selection in Excel 2007

查看:70
本文介绍了根据Excel 2007中的用户选择从XML文件中检索记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我真的需要一些方向。


 


我有一个Access数据库,其中包含产品详细信息。为了加快速度,我将其导出为XML文件并将我的Excel模板[用户界面]链接到此xml。


用户必须从中选择制造商和产品名称。 Excel模板中的下拉菜单。我需要指明如何匹配用户指定的制造商和产品名称,并将该特定记录放入Excel中的工作表中。我认为
这必须是VBA代码,因为我已经在Excel中寻找更好方法的选项。


谢谢!


 

解决方案

 


如果您正在尝试读取XML文件来自VBA,下面这段代码可能会有所帮助。


 
'请在System32文件夹中添加对msxml3 dll的引用以访问DOM Document。
Dim XMLDOC As New MSXML2.DOMDocument
XMLDOC.Load (" C:\ TEST \Sample.xml"
Dim nd 作为 IXMLDOMNode
对于 每个 nd In XMLDOC.ChildNodes
'遍历每个节点以获取所需的详细信息
下一步


Hi people. I really need some direction with this.

 

I have an Access database which contains product details. To make things faster, I have exported this to an XML file and linked my Excel template [user interface] to this xml.

A user will have to select a Manufacturer and Product name from the drop downs in the Excel template. I need some direction on how I can match the user specified Manufacturer and Product name and get that particular record into a sheet in Excel. I think this has to be VBA code because i have already looked around for options for better ways in Excel.

Thanks!

 

解决方案

Hi, 

If you are trying to read an XML file from VBA, following piece of code might be helpful.

  'Please add reference to msxml3 dll in System32 folder for access DOM Document.
  Dim XMLDOC As New MSXML2.DOMDocument
  XMLDOC.Load ("C:\TEST\Sample.xml")
  Dim nd As IXMLDOMNode
  For Each nd In XMLDOC.ChildNodes
    ' Loop through each node to get the required Details
  Next


这篇关于根据Excel 2007中的用户选择从XML文件中检索记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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