我使用this site的代码创建了一个xml架构。
Sub Create_XSD2()
Dim StrMyXml As String, MyMap As XmlMap
Dim StrMySchema As String
' Book.xml is the file created in section one of this topic.
StrMyXml = "C:\BookData.xml"
' Turn off async loading.
Application.DisplayAlerts = False
' Add the string to the XmlMaps collection.
Set MyMap = ThisWorkbook.XmlMaps.Add(StrMyXml)
Application.DisplayAlerts = True
' Create an empty file and output the schema.
StrMySchema = ThisWorkbook.XmlMaps(1).Schemas(1).XML
Open "C:\BookData2.xsd" For Output As #1
Print #1, StrMySchema
Close #1
End Sub
从xml文件导入数据后,所有内容都放在一行中。我怎么能改变它? 谢谢, Laurenz
答案 0 :(得分:1)
检查目录的路径!