Please see the enclosed Visual Studio Solution and the Excel File comment.xlsx.
The code is very simple:
ExcelEngine excelEngine = new ExcelEngine();
IWorkbook workbook = excelEngine.Excel.Workbooks.OpenReadOnly(@"comment.xlsx");
foreach (ICommentShape comment in workbook.ActiveSheet.Comments)
{
IRange range = workbook.ActiveSheet.Range[comment.Row, comment.Column];
Console.WriteLine($"Cell {range.AddressLocal} - actual comment: {comment.Text} - expected: {range.Number}");
}
It loops through the comments in the worksheet and writes them out to the console.
There is however a bug here: the last comment (cell A5) is empty - yet the Excel comment.xlsx does have a comment here...
Attachment:
ExcelTest_22ad53cb.zip