|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
How to: Display a String in a Worksheet Cell
The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.
Microsoft Office version
For more information, see Features Available by Application and Project Type.
This example demonstrates how to display text in a cell programmatically. To display text in cell, use either a NamedRange control or a native Excel range object.
This example uses a NamedRange control named message. The control must be added to a document-level customization at design time. The following code must be placed in a sheet class, not in the ThisWorkbook class.