0

我正在使用下面的代码将 xml 导出到 excel。

Sub ImportXMLtoList()  

    Dim strTargetFile As String  
    Application.DisplayAlerts = False
    strTargetFile = "C:\XML_Demo\demo.xml"  
    Workbooks.OpenXML Filename:=strTargetFile, LoadOption:=xlXmlLoadImportToList
    Application.DisplayAlerts = True  

End Sub

执行此代码时,电子表格中会显示 xml 值,但不会显示相应的标签。“demo.xml”是我放在这里的一个虚拟 xml,当我处理客户端数据时,我无法共享有这个问题的实际 xml。相同的代码适用于其他 xml。请让我知道会是什么问题。

4

1 回答 1

0

尝试Workbooks.OpenXML Filename:=strTargetFile, LoadOption:=xlXmlLoadOpenXml

于 2012-12-24T18:26:10.630 回答