Today I have a question about Google Apps Scripts, specifically for Spreadsheets. I\'ve already looked at the documentation here (yes, documentation on a Sheet<
Using Google Drive API in Google Apps Script, we could create Comments in a Google Document.
And after a test, I confirm you can also do it in a Spreadsheet (which is normal because Comments depends only on Drive API)
function insertDriveComment(fileId, comment, context) {
var driveComment = {
content: comment,
context: {
type: 'text/html',
value: context
}
};
Drive.Comments.insert(driveComment, fileId);
}
Keep in mind that you cannot attach programmatically the comment to a cell (or to words in Google Document), because anchors for Document and Spreadsheet Comments are proprietary (check the video at the bottom of the page here)
Hope it could help.