XmlMappedRange.Value2 Property (2007 System)

Gets or sets the XmlMappedRange control value.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
<TypeConverterAttribute(GetType(StringConverter))> _
Public Property Value2 As Object
'Usage
Dim instance As XmlMappedRange 
Dim value As Object 

value = instance.Value2

instance.Value2 = value
[TypeConverterAttribute(typeof(StringConverter))]
public Object Value2 { get; set; }
[TypeConverterAttribute(typeof(StringConverter))]
public:
property Object^ Value2 {
    Object^ get ();
    void set (Object^ value);
}
public function get Value2 () : Object 
public function set Value2 (value : Object)

Property Value

Type: System.Object
The value of the XmlMappedRange control.

Remarks

The difference between this property and the Value property is that Value2 is not a parameterized property.

Examples

The following code example compares how the Text and Value properties differ for cells that contain formatted numbers. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerLastNameCell.

Private Sub CompareTextAndValue2()
    Me.CustomerAddress1Cell.Value2 = 1198.3
    Me.CustomerAddress1Cell.NumberFormat = "$#,##0" 

    ' Displays "1198.3".
    MsgBox("The Value2 value is: " & Me.CustomerAddress1Cell.Value2.ToString())

    ' Displays "$1,198".
    MsgBox("The Text value is: " & Me.CustomerAddress1Cell.Text.ToString())
End Sub
private void CompareTextAndValue2()
{
    this.CustomerAddress1Cell.Value2 = 1198.3;
    this.CustomerAddress1Cell.NumberFormat = "$#,##0";

    // Displays "1198.3".
    MessageBox.Show("The Value2 value is: " + 
        this.CustomerAddress1Cell.Value2.ToString());

    // Displays "$1,198".
    MessageBox.Show("The Text value is: " +
        this.CustomerAddress1Cell.Text.ToString());
}

.NET Framework Security

See Also

Reference

XmlMappedRange Class

XmlMappedRange Members

Microsoft.Office.Tools.Excel Namespace