Skip to content

Instantly share code, notes, and snippets.

@conholdate-gists
Last active August 1, 2022 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conholdate-gists/eab22be91ed368b1b155b10573d75238 to your computer and use it in GitHub Desktop.
Save conholdate-gists/eab22be91ed368b1b155b10573d75238 to your computer and use it in GitHub Desktop.
convert Excel to XML in C#
// Create an instance of Workbook class and load the source Excel file
Workbook workbook = new Workbook("sample.xlsx");
// Invoke Save method to save as Excel 2003 Spreadsheet XML
workbook.Save("Spreadsheet.xml");
// Initialize an object of xmlSaveOptions class to save as plain XML data
XmlSaveOptions xmlSaveOptions = new XmlSaveOptions();
// save the XML file by calling the Save method
workbook.Save("data.xml", xmlSaveOptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment