How to: Send Values to Worksheet Cells
Updated: July 2008
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.
You can put a value in a cell by using a range. The following examples use the Value2 property of the range instead of the Value property to avoid having to pass in parameters.
To send a value to a cell in a document-level customization
To send a value to a cell in an application-level add-in
The following condition causes an exception:
The worksheet exists and is read-only (COMException class).
User input can include information that is potentially malformed, malicious, or not valid. Always check that the values that a user enters conform to the requirements for your application before using the values. For more information, see User Input Validation in Windows Forms.