XmlMappedRange.Value2 (Propiedad)

Obtiene o establece el valor del control XmlMappedRange.

Espacio de nombres:  Microsoft.Office.Tools.Excel
Ensamblado:  Microsoft.Office.Tools.Excel (en Microsoft.Office.Tools.Excel.dll)

Sintaxis

'Declaración
Property Value2 As Object
    Get
    Set
Object Value2 { get; set; }

Valor de propiedad

Tipo: System.Object
Valor del control XmlMappedRange.

Comentarios

La diferencia entre esta propiedad y la propiedad Value es que Value2 no es una propiedad parametrizada.

Ejemplos

En el siguiente ejemplo de código se compara cómo difieren las propiedades Text y Value para celdas que contienen números con formato. En este ejemplo de código se supone que la hoja de cálculo actual contiene un control XmlMappedRange denominado 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());
}

Seguridad de .NET Framework

Vea también

Referencia

XmlMappedRange Interfaz

Microsoft.Office.Tools.Excel (Espacio de nombres)