Add Threaded Comments in Excel using C#

This quick tutorial guides on how to add threaded comments in Excel using C#. It has IDE settings, a list of steps, and a sample code to insert comment in Excel using C#. You will also learn to add multiple threaded comments for a particular author.

Steps for Excel Threaded Comment using C#

  1. Set the environment to use Aspose.Cells for .NET to work with the threaded comments
  2. Instantiate the Aspose.Cells license to enable the full features of the product
  3. Create a new workbook or load an existing Excel file using the Workbook class object
  4. Access the target sheet and set the reference of the desired cell
  5. Set value in the selected cell using the PutValue method
  6. Create an author for the threaded comments using the ThreadedCommentAuthors property
  7. Add a threaded comment to the target cell using the above author
  8. Save the workbook as an Excel file with threaded comments

These steps have summarized the process to insert threaded comments. Create a workbook, add a sheet in it, select the target cell and set some value in it. Instantiate an author, insert a comment in the cell using the author object, and save the workbook as an Excel file.

Code for Threaded Comments in C#

This code has demonstrated the process to add comment in Excel using C#, which are advanced comments supporting features such as reply a comment, close a comment, and re0open a comment. Once the author is created, call the AddThreadedComment multiple times with the same author and different cells and comments for adding multiple comments.

This article has taught us the process to insert threaded comments in an Excel file. To merge Excel files, refer to the article Merge Excel Files using C#.