Syncfusion.XlsIO.Base
Example 


Comments Property (IWorksheet)

Gets the IComments collection in the worksheet.
Syntax
'Declaration
 
ReadOnly Property Comments As IComments
'Usage
 
Dim instance As IWorksheet
Dim value As IComments
 
value = instance.Comments
IComments Comments {get;}
Example
The following code illustrates how to access the IComments collection in the worksheet.
using Syncfusion.XlsIO;
using System;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet sheet = workbook.Worksheets[0];
            
            // Adding comments to a cell.
            ICommentShape comment1 = sheet.Range["A1"].AddComment();
            ICommentShape comment2 = sheet.Range["B1"].AddComment();
            
            //Set comment text
            comment1.Text= "Comment1";
            comment2.Text= "Comment2";
            
            //Check count
            Console.Write(worksheet.Comments.Count);
            
            //Save and dispose
            workbook.SaveAs("Comments.xlsx");
            workbook.Close();
            Console.ReadKey();
        }
    }
}
//Output will be
//2
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also