How to Insert Comment in Excel using C#

This simple tutorial will explain the whole process of how to insert comment in Excel using C#. It explains in quite a simple manner to add comments in Excel using C# by providing the detailed steps and running sample code. To accomplish this task, simply load the input file, add or insert a comment in a specific cell and write the output file in XLSX, XLS or any other MS Excel supported format.

Steps to Insert Comment in Excel using C#

  1. Configure Aspose.Cells with the NuGet package manager to add comments in Excel
  2. Create an object of Workbook class
  3. Access a Worksheet with a numeric value
  4. Add the comment and set its note
  5. Save the output Excel file in XLSX format after adding the comment

These easy steps demonstrate the quick process to insert note in Excel using C#. Load the input workbook as the first step and access the specific cell in a worksheet. Subsequently, insert the comment and write the output file at the disk or a stream based on your requirements.

Code to Insert Comment in Excel using C#

This code snippet is a basic demonstration of how to add comments in Excel using C#. Besides this scenario, we can update the code to add threaded comments, author name, comment shape, size, etc. Likewise, you can make changes to add one or more comments to multiple files with a few API calls.

This basic tutorial has covered how to add a note in Excel using C#. If you are interested to merge cells in an Excel file, refer to the article on how to merge cells in Excel using C#.

 English