Comments, Notes and Hyperlinks
When a cell needs an explanation, a review remark or a link, you attach a comment, a note or a hyperlink to it. All three add information to the cell without replacing its numeric or formula value. Use worksheet-bound cells, so that the target does not depend on the current selection.
Work With Comment Threads
Comments support thread-related operations through cell.comments, the Cell.comments property. It returns the CellComments of the cell, the conversation of that cell:
- add starts a conversation or appends a reply.
- edit changes an entry of the current user.
- resolve resolves or reopens the conversation.
- remove removes an entry of the current user, or the whole thread.
- thread returns a detached snapshot of the thread.
Set the user name of the control or the workbook, Spreadsheet.userName or Workbook.userName, to identify the application author.
The comments UI can be shown or hidden through editor.ui.comments, the EditorUi.comments property. The popups and the sidebar on the screen are not printed worksheet content.
Add Notes and Hyperlinks
- Notes are lightweight cell annotations with supported visibility and bounds settings. Cell.setNote sets the note of a cell, and Cell.note returns it as a CellNote.
- Hyperlinks carry a safe target and optional display metadata. Cell.setHyperlink sets the hyperlink of a cell, and Cell.hyperlink returns it as a CellHyperlink. Follow the documented target validation rather than treating every string as an allowed executable URL.
To follow a hyperlink in the browser editor, select its cell and press Ctrl+Enter, or Ctrl+click the cell. Internal targets such as #B4 or #Summary!C3 select a cell in the current workbook. If an internal target is malformed, refers to a missing name or worksheet, or points into an external workbook, activation leaves the current worksheet and selection unchanged.
In the .NET API, the corresponding models are Comments, CellNote and CellHyperlink.
Annotate Cells in the Editor and in Code
In the editor, select a cell and use the commands of the Review tab or the context menu for the annotation you need.
In code, inspect the detached snapshots first. Then use the explicit methods to add, update, reply, resolve, remove or change supported properties. Preserve the identity of the thread and the cell when you respond to a comment.
What Hiding Does Not Protect
Application authorization remains separate: hiding a sidebar is not a permission model.
Warning
Private Credentials. Do not store private credentials in notes, comments, cell values or hyperlinks that will be included in downloadable workbooks.
Save and Export Annotations
Supported annotations survive the appropriate workbook formats. Visibility on the screen does not imply inclusion in a PDF, so review the document and export options for what is represented in the output. Treat warnings about imported annotations as part of the conversion result.
Next Steps
- Events and Cancellation: react to changes in your application.
- Ribbon and Contextual Commands: find the comment, note and protection commands of the Review tab.
- Worksheet Protection: restrict editing commands on a worksheet.