Excel Add In Can't Add Comments - This operation is not implemented.

Arnav Garg 0 Reputation points
2024-06-24T20:40:03.5366667+00:00

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?

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,639 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,671 questions
0 comments No comments
{count} votes