How to Insert Comment in Excel using Node.js

This short tutorial guides on how to insert comment in Excel using Node.js. It has detailed instructions to set up the development environment, a list of programming tasks, and a running sample code showing how to add comments in Excel using Node.js. You will also learn different properties that can be set while adding a new comment in a cell.

Steps to Add Comments in Excel using Node.js

  1. Set the development environment to use Aspose.Cells for Node.js via Java to add comments
  2. Load the workbook and access the worksheet where a comment is to be added
  3. Access the comments collection of the selected sheet and call the add() method to add a comment
  4. Access the newly created comment to set the text for the comment
  5. Save the resultant workbook with a comment in it

The aforementioned steps explain how to add a note in Excel using Node.js. In the beginning, the target workbook is loaded and the target worksheet is selected to access the comments collection in it. The add() method is used to insert a comment and setNote() method is used to set the text for the comment.

Code to Insert Comment in Excel using Node.js

This code sample demonstrates how to insert note in Excel using Node.js. The CommentCollection class contains a number of features to work with the comments like adding a comment, removing a comment, getting the count of comments, and deleting all the comments. Similarly, you can set different properties of the comment like the author name, the comment shape, height and width, and visibility flag to list a few.

In this short article, we have learned how to make a note in Excel using Node.js. If you want to learn the process of un-protecting a worksheet, refer to the article on how to un-protect Excel sheet using Node.js.

 English