How to: Display a String in a Worksheet Cell
Some code examples in this topic use the this or Me keyword or the
This example demonstrates how to display text in a cell programmatically. You can create a named range to reference the cell.
The range object can be one of two types:
Native Excel object.
Excel Microsoft.Office.Interop.Excel.Range objects do not have events or data binding capabilities.
Using Host Controls
The following code assumes you have added a NamedRange control named
message to a worksheet named
To display text in a NamedRange control
Using Excel Objects
The following code creates a new range programmatically and then assigns it a value.
To display text in an Excel Range
Compiling the Code
The host control code must be placed in a sheet class, not in the