NamedRange::AddComment Method (Object^)
Adds a comment to the NamedRange control.
Assembly: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Parameters
- Text
-
Type:
System::Object^
The comment text.
Return Value
Type: Microsoft.Office.Interop.Excel::Comment^Comments can only be added to NamedRange controls that consist of a single cell. You cannot add a comment if the NamedRange control has more than one cell.
For information on optional parameters, see Optional Parameters in Office Solutions.
The following code example uses the AddComment method to add the comment "This is Martha's range." to a NamedRange control that includes cell A1.
This example is for a document-level customization.
Show: