I am working with office js. my add-in inserts a comment in the cell that is working properly with mac system office and office 365 but I can't insert comments in the windows system office. the version of office 2016. what did I do wrong? Please guide me thanks.
Here is my code snippet
await Excel.run(async (ctx) => { let wb = ctx.workbook;
await ctx.sync().then(async () => {
try {
const address="sheet!A4"
var comment = wb.comments.getItemByCell(address);
comment.delete();
wb.comments.add(address, "This is simple test comment");
} catch (error) {
if (error.code == Excel.ErrorCodes.itemNotFound) {
wb.comments.add(address, "This is simple test comment");
console.log("Add comment successfully!");
}
}
});
await ctx.sync();
});