If an author with the name “John Smith” comments on a cell in an excel spreadsheet, I am not able to get back “John Smith”. Instead what I get back, using epplus, is a guid that has this format:
tc={xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
here is some sample code for context:
using (var package = new ExcelPackage(new FileInfo(pathToExcelFile))){
var worksheet = package.Workbook.Worksheet[0];
var cell = worksheet.Cells[0,0]; // comment made by John Smith is on this cell
var result = cell.Comment.Author; // result is tc={12345678-1234-1234-1234-123456789123}
}
Not sure why epplus is not able to get the actual author name. Also, I tried using the guid assuming it was the correct guid within active directory:
UserPrincipal.FindByIdentity(new PrincipalContext(ContextType.Domain), IdentityType.Guid, guid)
but that did not work either. How can I get the name of a commenter on a cell?
Hanlov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.