Remove a single comment (Java)

Hi,

Would it be possible to add a method like Shapes.removeComment(int row, int col)?
Today I cannot find any way of deleting a single comment for a specific cell.

Thanks and best regards,
Ulf Ekström

Hi Ulf,

We will check if we could add your proposed method soon.

Thank you.

Hi Ulf,

We have added support for removing individual shapes including comments for your need. Please try the attached version (Aspose.Cells for Java 1.9.4.4).

In this fix, some new methods for Shapes class are added:

  • removeComment(int row,int column), removeComment(String cellName) for removing Comment of specific cell
  • removeShape(int index), removeShape(Shape shape) for removing common Shape, including Comment.

Sample code:

Workbook workbook = new Workbook();
workbook.open("E:\\Files\\comments_book.xls");
Worksheets worksheets = workbook.getWorksheets();
Worksheet sheet = worksheets.getSheet(0);
Shapes shapes = sheet.getShapes();
shapes.removeComment("D10");
workbook.save("E:\\Files\\out_commentsbook.xls");

Thank you.

Hi,

Thanks for your quick help!!!

Best regards,
Ulf