Excel Add In Can't Add Comments - This operation is not implemented.
I'm currently on MacOS Sonoma (14.5) using Office16.86 (appears to be as updated as possible) building an Excel add in. I am trying to programatically add a comment to Excel on a specific cell through taskpane.js.
However, every time I try to add this comment, I get "This operation is not implemented." I am using the below code:
Excel.run(async context => {
const range = context.workbook.getSelectedRange();
let comments = context.workbook.comments;
comments.add(range, "TODO: add data.");
await context.sync();
logMessage('Comment inserted into Excel');
}).catch(error => {
logMessage(`Error inserting comment into Excel: ${error.message}`);
});
}
Does anyone have any suggestions on how to do it?
Alternatively, my whole use case is I just want to store meta information about the cell and the best way I could think of doing it was through a comment, but do cells have metadata (or something similar) that I can access programatically to store/retrieve the meta information?