Tuesday, 19 July 2011 06:38

Export Excel to XML and Import XML to Excel

Written by  support iceblue
Rate this item
(0 votes)

How can we export Excel to Office Open XML and import Office Open XML to Excel quickly and with sound quality? The answer is what most developers desire to know and clients concern. Here will demonstrate an effortless method to export Excel to Office Open XML and import Office Open XML to Excel separately or synchronously.

Spire.XLS for .NET is a professional .NET Excel component which enables us to fast export Excel to Office Open XML or import Office Open XML to Excel within just three steps. The export/import features such unique as below:

  • Microsoft Excel is not necessary on client and/or server side.
  • Export/import can be proceeding separately or synchronously.

Excel to XML

Spire.Xls for .NET always welcomes any kind of trial or evaluation, so feel free to download Spire.XLS for .NET to realize transform between Excel and Office Open XML within 3 steps.

PS: Spire.Xls only supports Office OpenXML.

Export Excel to Office Open XML in C#, VB.NET

The whole process of exporting Excel to Office Open XML in C#, VB.NET can be described as 3 simple steps:

  • Create a new workbook
  • Load information from excel file and transfer into workbook
  • Save workbook as Office Open XML file format

The following is the code sample that we use to export Excel to Office Open XML in C#, VB.NET

[C#]
Workbook wb = new Workbook();
wb.LoadFromFile(@"..\..\sample.xlsx");
wb.SaveAsXml("result.xml");
[VB.NET]
Dim wb As New Workbook()
wb.LoadFromFile(@"..\..\sample.xlsx")
wb.SaveAsXml("result.xml")

Import Office Open XML to Excel in C#, VB.NET

In this section, you will feel it is as easy as ABC to import Office Open XML to Excel in C#, VB.NET. This process will also be completed in 3 steps too. Please see the codes below:

[C#]
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"..\..\test.xml");
workbook.SaveToFile("result.xlsx",ExcelVersion.Version2010);
[VB.NET]
Dim workbook As New Workbook()
workbook.LoadFromFile("..\..\test.xml")
workbook.SaveToFile("result.xlsx",ExcelVersion.Version2010)

Additional Info

  • tutorial_title: Export Excel to XML and Import XML to Excel
Last modified on Wednesday, 29 March 2017 08:48