Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save conholdate-gists/44bc96798dbf6ae039981c701fffe786 to your computer and use it in GitHub Desktop.
Save conholdate-gists/44bc96798dbf6ae039981c701fffe786 to your computer and use it in GitHub Desktop.
Clear data from Excel spreadsheet
// clear the content of an SLSX file
var aspose = aspose || {};
// create an object of the Cells class.
aspose.cells = require("aspose.cells");
// instantiates WorkBook child class with an XLSX file
var sampleFile = "sample.xlsx";
var workbook = new aspose.cells.Workbook(sampleFile);
// call clear() method to clear all cell and row objects.
workbook.getWorksheets().get(0).getCells().clear();
// save the data into a new xlsx file
workbook.save("result.xlsx");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment