Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

NamedRange.Value Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets or sets the value of the NamedRange control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Object Value { get; set; }

Property Value

Type: System.Object
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#.

Parameter

Description

RangeValueDataType

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

_arg1

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

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

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

This version is for a document-level customization.

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

    Microsoft.Office.Tools.Excel.NamedRange namedRange2 =
        this.Controls.AddNamedRange(this.Range["A2"],
        "namedRange2");
    namedRange2.set_Value(Excel.XlRangeValueDataType.xlRangeValueDefault,
        "Jones");
}

This version is for an application-level add-in.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.