Vba-Excel 如何从 Excel 的电子表格生成 XML 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14660930/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 19:26:13  来源:igfitidea点击:

Vba-Excel How to generate XML file from a SpreadSheet of Excel?

excelvba

提问by SaiKiran Mandhala

I have been searching for the logic to convert the SpreadSheet data of an excel into XML format. enter image description here

我一直在寻找将excel的SpreadSheet数据转换为XML格式的逻辑。 在此处输入图片说明

I have the thousands of data like shown below. i want to convert this into XML format. Anyone please help me, any help would be appreciated greatly.

我有成千上万的数据,如下所示。我想将其转换为 XML 格式。任何人都请帮助我,任何帮助将不胜感激。

采纳答案by Peter L.

According to the screenshot, your Excel version allows to save your document using XML Spreadsheet 2003format: Save As... > Other Formatsand locate it in the dropdown (at least for Excel 2007 it works as described).

根据屏幕截图,您的 Excel 版本允许使用XML Spreadsheet 2003format:保存您的文档Save As... > Other Formats并在下拉列表中找到它(至少对于 Excel 2007,它的工作原理与描述相同)。

Resulting XML will contain much of the native Excel Workbook fields and nodes, but they're might be easily removed using any more or less advanced XML editor, e.g. Altova XMLSpyor any similar. However, cleanup depends entirely on your further needs.

生成的 XML 将包含许多本机 Excel 工作簿字段和节点,但可以使用任何或多或少高级的 XML 编辑器轻松删除它们,例如Altova XMLSpy或任何类似的。但是,清理完全取决于您的进一步需求。

For your convenience may see sample Excel book and XML generated from it as described above: https://www.dropbox.com/s/kxmxu2tq52y4m9b/ExcelToXML.zip

为方便起见,您可以查看如上所述的示例 Excel 书籍和从中生成的 XML:https: //www.dropbox.com/s/kxmxu2tq52y4m9b/ExcelToXML.zip

Good luck!

祝你好运!