Condividi tramite


XmlMappedRange.Errors Property

Gets an Errors object that enables you to access error checking options of an XmlMappedRange control.

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

Syntax

'Declaration
ReadOnly Property Errors As Errors
Errors Errors { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.Errors
An Errors object that enables you to access error checking options of an XmlMappedRange control.

Remarks

Reference the Errors object to view a list of index values associated with error checking options.

Examples

The following code example inserts a number written as text into an XmlMappedRange, and then uses the Errors property to determine whether the number is written as text. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerLastNameCell.

Private Sub CheckForErrors()
    Me.CustomerLastNameCell.Formula = "'12" 

    If Me.CustomerLastNameCell.Errors( _
        Excel.XlErrorChecks.xlNumberAsText).Value Then
        MsgBox("The number is written as text.")
    Else
        MsgBox("The number is not written as text.")
    End If 
End Sub
private void CheckForErrors()
{
    this.CustomerLastNameCell.Formula = "'12";

    if (this.CustomerLastNameCell.Errors[
        Excel.XlErrorChecks.xlNumberAsText].Value)
    {
         MessageBox.Show("The number is written as text.");
    }
    else
    {
        MessageBox.Show("The number is not written as text.");
    }
}

.NET Framework Security

See Also

Reference

XmlMappedRange Interface

Microsoft.Office.Tools.Excel Namespace