---
title: "How to Add Comments to Excel Documents Using C#"
published_at: "2023-09-29T11:16:29+00:00"
modified_at: "2026-01-09T08:39:19+00:00"
url: "https://www.syncfusion.com/blogs/post/add-comments-in-excel-csharp"
excerpt: "This blog explores the new threaded comments feature released in the 2023 Volume 3 release for the Syncfusion Excel Library."
taxonomy_category:
  - "C#"
  - "Excel"
  - "File Formats"
  - "What's new"
  - "XlsIO"
taxonomy_post_tag:
  - ".NET"
  - "C#"
  - "Essential XlsIO"
  - "File Formats"
  - "What's New"
---

# How to Add Comments to Excel Documents Using C#

[Mohan Chandran](https://www.syncfusion.com/blogs/author/mohan-chandran)

![How to Add Comments to Excel Documents Using C#](https://www.syncfusion.com/blogs/wp-content/uploads/2023/09/How-to-Add-Comments-to-Excel-Documents-Using-C.png)


Commenting is a useful feature in Excel documents that allows users to add additional information about specific cell data, calculations, and references used inside a cell. Comments serve as a form of documentation to help you and others understand the content and context of your Excel workbook. They are particularly useful when sharing workbooks with other collaborators.

From the [2023 Volume 3](https://www.syncfusion.com/forums/184588/essential-studio-2023-volume-3-main-release-v23-1-36-is-available-for-download)
 release on, the [Syncfusion Excel Library (XlsIO)](https://www.syncfusion.com/document-processing/excel-framework/net)
 supports adding [threaded comments](https://help.syncfusion.com/file-formats/xlsio/working-with-drawing-objects#threaded-comments)
 to Excel documents. With this feature, you can allow multiple users to add comments or reply to existing comments in an Excel worksheet.


You can perform the following actions with threaded-comments support in the Excel Library:

- [Create a new threaded comment](https://help.syncfusion.com/file-formats/xlsio/working-with-drawing-objects#create) for a cell.
- [Reply](https://help.syncfusion.com/file-formats/xlsio/working-with-drawing-objects#reply) to existing comments.
- Mark the discussion in the comments as [resolved](https://help.syncfusion.com/file-formats/xlsio/working-with-drawing-objects#mark-as-resolved) .

Let’s see how to perform these actions with code examples!

**Note:** If you are new to our Excel Library, following our [getting started guide](https://help.syncfusion.com/file-formats/xlsio/getting-started-create-excel-file-csharp-vbnet)
 is highly recommended.

## Add comment

A comment can be any text related to the cell information. The following code example illustrates how to add threaded comments to a cell in a worksheet.

```
using (ExcelEngine excelEngine = new ExcelEngine())
{
    IApplication application = excelEngine.Excel;
    application.DefaultVersion = ExcelVersion.Xlsx;

    FileStream inputStream = new FileStream("../../../Data/CommentsTemplate.xlsx", FileMode.Open, FileAccess.Read);
    IWorkbook workbook = application.Workbooks.Open(inputStream, ExcelOpenType.Automatic);

    IWorksheet worksheet = workbook.Worksheets[0];

    //Add threaded comments.
    IThreadedComment threadedComment = worksheet.Range["H16"].AddThreadedComment("What is the reason for the higher total amount of \"desk\"  in the west region?", "User1", DateTime.Now);

    FileStream stream = new FileStream("output.xlsx", FileMode.Create, FileAccess.ReadWrite);
    workbook.SaveAs(stream);
    workbook.Close();
    excelEngine.Dispose();
}
```

This results in the following image.

![Adding a threaded comment in an Excel document](https://www.syncfusion.com/blogs/wp-content/uploads/2023/09/Adding-a-threaded-comment-in-an-Excel-document.png)

Adding a threaded comment in an Excel document


## Reply to comment

You can add a reply to an existing comment in an Excel document. The following code example illustrates how to add a reply to a comment using C#

```
//Add threaded comments.
IThreadedComment threadedComment = worksheet.Range["H16"].AddThreadedComment("What is the reason for the higher total amount of \"desk\"  in the west region?", "User1", DateTime.Now);
                
//Add reply to the threaded comment.
threadedComment.AddReply("The unit cost of desk is higher compared to other items in the west region. As a result, the total amount is elevated.", "User2", DateTime.Now);
```

Refer to the following image.

![Replying to a comment in an Excel document](https://www.syncfusion.com/blogs/wp-content/uploads/2023/09/Replying-to-a-comment-in-an-Excel-document.png)

Replying to a comment in an Excel document


## Mark as resolved

You can also mark a discussion (comments) created for a cell as resolved. This way, other users know to ignore the discussion.

The following code example illustrates how to mark a discussion as resolved.

```
//Add threaded comments.
IThreadedComment threadedComment = worksheet.Range["H16"].AddThreadedComment("What is the reason for the higher total amount of \"desk\"  in the west region?", "User1", DateTime.Now);
                
//Add reply to the threaded comment.
threadedComment.AddReply("The unit cost of desk is higher compared to other items in the west region. As a result, the total amount is elevated.", "User2", DateTime.Now);

//Mark as resolved.
threadedComment.IsResolved = true;
```

Refer to the following image.

![Marking a discussion as resolved in an Excel document](https://www.syncfusion.com/blogs/wp-content/uploads/2023/09/Marking-a-discussion-as-resolved-in-an-Excel-document.png)

Marking a discussion as resolved in an Excel document

## GitHub reference

You can download examples of [threaded comments in Excel documents using C# from this GitHub page](https://github.com/SyncfusionExamples/XlsIO-Examples/tree/master/Threaded%20Comments)
.


## Conclusion

Thanks for reading! In this blog, we’ve explored the new [threaded comments](https://help.syncfusion.com/file-formats/xlsio/working-with-drawing-objects#threaded-comments)
 feature added to the [Syncfusion Excel Library (XlsIO)](https://www.syncfusion.com/excel-framework/net)
 for the [2023 Volume 3](https://www.syncfusion.com/forums/184588/essential-studio-2023-volume-3-main-release-v23-1-36-is-available-for-download)
 release. This feature is useful for collaborating on Excel documents and getting feedback from others.

Take a moment to peruse the [documentation](https://help.syncfusion.com/file-formats/xlsio/working-with-data#importing-data-to-worksheets)
, where you’ll find other Excel options and features like [conditional formatting](https://help.syncfusion.com/file-formats/xlsio/working-with-conditional-formatting)
, [tables](https://help.syncfusion.com/file-formats/xlsio/working-with-excel-tables)
, [pivot tables](https://help.syncfusion.com/file-formats/xlsio/working-with-pivot-tables)
, and [charts](https://help.syncfusion.com/file-formats/xlsio/working-with-charts)
.

Using the Excel Library, you can export Excel data to [PDF](https://help.syncfusion.com/file-formats/xlsio/excel-to-pdf-conversion)
, [image](https://help.syncfusion.com/file-formats/xlsio/worksheet-to-image-conversion)
, [data table](https://help.syncfusion.com/file-formats/xlsio/working-with-data#exporting-from-worksheet-to-data-table)
, [CSV](https://www.syncfusion.com/kb/9092/convert-excel-file-to-csv-in-c-vb-net)
, [TSV](https://www.syncfusion.com/kb/8556/does-xlsio-support-tsv-files)
, [HTML](https://help.syncfusion.com/file-formats/xlsio/working-with-excel-worksheet#save-worksheet-as-html)
, [collections of objects](https://help.syncfusion.com/file-formats/xlsio/working-with-data#exporting-from-worksheet-to-clr-objects)
, [ODS](https://help.syncfusion.com/file-formats/xlsio/excel-to-ods-conversion)
, [JSON](https://help.syncfusion.com/file-formats/xlsio/excel-to-json-conversion)
, and more file formats.

Are you already a Syncfusion user? You can download the product setup [here](https://www.syncfusion.com/account/downloads/studio/)
. If you’re not a Syncfusion user yet, you can download a free 30-day trial [here](https://www.syncfusion.com/downloads/fileformats/confirm)
.

Please let us know in the comments section below if you have any questions about these features. You can also contact us through our [support forum](https://www.syncfusion.com/forums)
, [support portal](https://support.syncfusion.com/)
, or [feedback portal](https://www.syncfusion.com/feedback/excel)
. We are always happy to assist you!

## Related blogs

- [Easiest Ways to Highlight Data in Excel Using C#](https://blog.syncfusion.com/blogs/post/highlight-data-in-excel-using-csharp.aspx)
- [6 Easy Ways to Export Data to Excel in C#](https://www.syncfusion.com/blogs/post/6-easy-ways-to-export-data-to-excel-in-c-sharp.aspx)
- [Export Data from Collection to Excel and Group It in C#](https://www.syncfusion.com/blogs/post/export-data-from-collection-to-excel-and-group-csharp.aspx)
- [Export Data to a Predefined Excel Template in C#](https://www.syncfusion.com/blogs/post/export-data-to-a-predefined-excel-template-in-c.aspx)
- [Easy Steps to Export HTML Tables to an Excel Worksheet in C#](https://www.syncfusion.com/blogs/post/easy-steps-to-export-html-tables-to-an-excel-worksheet-in-c.aspx)
