XML-Schema – 导入架构中的新行

我用这个站点的代码创build一个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文件中导入数据后,所有内容都放在一行中。 我该如何改变? 谢谢,劳伦斯

检查目录的path!