How to Delete Pivot Table using Node.js

This short tutorial describes how to delete pivot table using Node.js. It provides the instructions to set the development environment, a list of programming steps, and a runnable sample code demonstrating how to delete pivot table in Excel using Node.js. You will also learn the option to decide on the deletion of the data linked with the pivot table.

Steps to Delete Pivot Table using Node.js

  1. Set the environment to use Aspose.Cells for Node.js via Java to delete a pivot table
  2. Load the workbook containing data and a pivot table in it
  3. Access the target worksheet where pivot tables are present
  4. Remove the desired pivot table using its index in the removeAt() method
  5. Save the resultant workbook after deleting the pivot table using Node.js

The above-mentioned steps explain how to remove pivot table using Node.js. In the first step, the target workbook is loaded and the respective worksheet is selected where pivot tables are present. Using the removeAt() method in the PivotTableCollection class, the target pivot table is deleted using the index.

Code to Remove Pivot Table using Node.js

This code segment demonstrates how to remove pivot table in Excel using Node.js. The PivotTableCollection class contains multiple methods to delete pivot tables using their index or PivotTale name. An additional flag keepData can be used to remove the data as well along with the pivot table.

This article has taught us how to remove the pivot table in Excel using Node.js. If you want to learn how to delete a column in an Excel file, refer to the article on how to delete a column in Excel using Node.js.

 English