How to Remove Comment in Excel using Java

This quick tutorial will let you understand all the details about how to remove comment in Excel using Java. It contains the configuration details, a sample code, and a step-by-step guide to remove comments from Excel using Java. You will also learn the process to delete all the comments from a worksheet at once or delete the comments by specifying the target cell reference in different formats and save the output workbook as an XLSX, XLS, or in any of the supported formats.

Steps to Remove Comment in Excel using Java

  1. Set the reference of Aspose.Cells library from the repository
  2. Initialize an object of the Workbook class
  3. Specify the index to access a Worksheet
  4. Get access to the comments collection in the worksheet
  5. Remove the comment from the desired cell
  6. Save output Excel file

These simple steps summarize the whole process to delete comments in Excel using Java. In the first step, you need to access the input file and a worksheet with its index value. Subsequently, delete the comment by accessing it from the Comments collection in the selected worksheet and save the updated Excel file on the disk or stream.

Code to Remove Comments from Excel using Java

The code snippet above uses a few API calls that answer the question about how to remove pop up comments in Excel using Java. Moreover, you can uncomment the line of code to delete all the comments at once. Likewise, you can also choose to delete a comment by specifying its row and column index, or the cell name based on your requirements.

This short tutorial covers the details of different approaches to remove comments from a cell in an Excel file. However, if you want to learn the reverse feature for inserting a comment, head to the article on how to insert comments in Excel using Java.

 English