Value Property
Collapse the table of content
Expand the table of content
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. ArchiveDisclaimer

NamedRange.Value Property

Gets or sets the value of the NamedRange control.

Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in

public Object Value { get; set; }

Property Value

The value of the NamedRange control.

The Value property can be used with the following optional parameters. If you specify the optional parameters, you must use the set_Value and get_Value accessors in Visual Basic and C#.




One of the XlRangeValueDataType values that specifies the data type of the range value. The default is xlRangeValueDefault.


The value of the NamedRange control. This parameter is used only with the set_Value set accessor.

Optional Parameters

For information on optional parameters, see Understanding Optional Parameters in COM Interop.

The following code example demonstrates how to set the Value property with and without the optional parameters.

private void SetValue()
    Microsoft.Office.Tools.Excel.NamedRange namedRange1 =
        this.Controls.AddNamedRange(this.Range["A1", missing],
    namedRange1.Value = "Smith";

    Microsoft.Office.Tools.Excel.NamedRange namedRange2 =
        this.Controls.AddNamedRange(this.Range["A2", missing],

© 2015 Microsoft