Want the ability to remove page by index in aspose cells python via net

Looking for increased functionality around removing worksheets. Currently, for Aspose Cells via Net the only way to remove a worksheet is to find the name of the worksheet and use Workbook.worksheets.remove_at(“name”). I would like to be able to remove from the worksheets collection via index as well as name. I would also like a method on the worksheet object itself to remove it from its corresponding workbook.

@acn,

It seems that the remove_at(index) method is not present in Aspose.Cells for Python via .NET, although it (removeAt(index)) is present in Aspose.Cells for Python via Java. We will evaluate your requirements and try to implement it if possible.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSPYTHONNET-192

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@acn
The issues you have found earlier (filed as CELLSPYTHONNET-192) have been fixed in Aspose.Cells for Python via .NET 24.4. You can download from release page or install it by pip install aspose-cells-python.
We added the method remove() to the Worksheet class and added the methods remove_by_index() and remove_by_name() to the WorksheetCollection class.

Here is an example demonstrating the specific usage.

workbook = Workbook()
# Add Sheet2
workbook.worksheets.add()
# Add Sheet3
workbook.worksheets.add()
# Add Sheet4
workbook.worksheets.add()
worksheets = workbook.worksheets
worksheet  = workbook.worksheets[0]
# Remove Sheet1
worksheet.remove()
# Remove Sheet2 by sheet index
worksheets.remove_by_index(0)
# Remove Sheet3 by  sheet name
worksheets.remove_by_name("Sheet3")
# Only Sheet4 left
workbook.save("out.xlsx")