Skip to content

Instantly share code, notes, and snippets.

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/4e372bd6ed768f0e05a78b5d58832b17 to your computer and use it in GitHub Desktop.
Save conholdate-gists/4e372bd6ed768f0e05a78b5d58832b17 to your computer and use it in GitHub Desktop.
Convert Excel XLSX XLS to JSON in C# .NET
// Load Excel file
Workbook wb = new Workbook("Workbook.xlsx");
// Create JsonSaveOptions class object
Aspose.Cells.JsonSaveOptions options = new Aspose.Cells.JsonSaveOptions();
options.SkipEmptyRows = true;
options.ExportAsString = true;
// Save as JSON
wb.Save("Excel_to_JSON.json", options);
// Load Excel file
Workbook wb = new Workbook("Workbook.xlsx");
// Save as JSON
wb.Save("Excel_to_JSON.json", Aspose.Cells.SaveFormat.Json);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment