Hi,
i solved using the below mentioned code.
SpreadsheetDocument spreadSheetDocument = SpreadsheetDocument.Open(/* Excel File Name */, true);
WorkbookPart workBookPart = spreadSheetDocument.WorkbookPart;
List<string> lstComments = new List<string>();
foreach (WorksheetPart sheet in workBookPart.WorksheetParts)
{
foreach (WorksheetCommentsPart commentsPart in sheet.GetPartsOfType<WorksheetCommentsPart>())
{
foreach (Comment comment in commentsPart.Comments.CommentList)
{
lstComments.Add(comment.InnerText);
}
}
}
lstComments contains the Comments present in all the sheets. We can further refine it for a particular sheet also.
Thanks and Regards,
Kishor Reddy