Last active
July 16, 2023 16:51
Revisions
-
aspose-com-kb revised this gist
Jul 16, 2023 . No changes.There are no files selected for viewing
-
aspose-com-kb created this gist
Jul 14, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ import jpype import asposecells jpype.startJVM() from asposecells.api import License, Workbook # Instantiate the license license = License() license.setLicense("Aspose.Total.lic") # Create a workbook object from the source Excel file workbook = Workbook("pivotTable.xls") # Access the first worksheet worksheet = workbook.getWorksheets().get(0) # Access the first pivot table object pivotTable = worksheet.getPivotTables().get(0) # Remove the pivot table using the pivot table object worksheet.getPivotTables().remove(pivotTable) # Second option is to delete the pivot table using its index # worksheet.getPivotTables().removeAt(0); # Save the workbook workbook.save("output_out.xlsx") print("Pivot Table removed successfully") jpype.shutdownJVM()