This brief tutorial guides you on how to insert comment in Excel using Java. It contains the step-by-step details and the code sample to add comments in Excel using Java. In a nutshell, you only need to load the source file, add any comments and then save the created file in any of the Excel-supported file formats like XLSX, XLS, etc.
Steps to Insert Comment in Excel using Java
- Set Aspose.Cells reference from the repository to add comments in Excel
- Load the input Excel file with the object of the Workbook class
- Specify the sheet index to access a particular Worksheet
- Add a comment and set a string as its note
- Save the output Excel file with the added comment as an XLSX file
These steps summarize all of the details to insert note in Excel using Java. You can achieve the requirements by loading any worksheet within a workbook and then accessing a particular cell. Now you can append the comment or note to record the feedback or information.
Code to Insert Comment in Excel using Java
This source code is a crisp answer to the question of how to add comments in Excel using Java. In addition to this code, many other properties can also be set for adding threaded comments, comment author, size, and other appearance properties. Furthermore, you do not need to install MS Excel because the API is capable of working with Excel files by itself.
This short tutorial is intended to cover how to add a note in Excel using Java. If you want to adjust the width of a column in a worksheet, refer to the article on how to adjust column width in Excel using Java.