Errors._Default Property
Allows the user to to access error checking options.
Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)
Syntax
'Declaration
ReadOnly Default Property _Default ( _
Index As Object _
) As Error
Get
'Usage
Dim instance As Errors
Dim Index As Object
Dim value As Error
value = instance(Index)
Error this[
Object Index
] { get; }
Parameters
- Index
Type: System.Object
Property Value
Type: Microsoft.Office.Interop.Excel.Error
Remarks
Reference the Errors object to view a list of index values associated with error checking options.
Examples
In this example, a number written as text is placed in cell A1. Microsoft Excel then determines if the number is written as text in cell A1 and notifies the user accordingly.
Sub CheckForErrors()
Range("A1").Formula = "'12"
If Range("A1").Errors.Item(xlNumberAsText).Value = True Then MsgBox "The number is written as text." Else MsgBox "The number is not written as text." End IfEnd Sub