ErrorString Property

Microsoft Excel Visual Basic

Returns or sets the string displayed in cells that contain errors when the DisplayErrorString property is True. The default value is an empty string (""). Read/write String.

expression.ErrorString

expression    Required. An expression that returns one of the above objects.

ShowErrorString property as it applies to the ODBCError and OLEDBError objects.

Returns the ODBC error string. Read-only String.

expression.ErrorString

expression    Required. An expression that returns one of the above objects.

Example

This example displays a hyphen in cells in the specified PivotTable report that contain errors.

With Worksheets(1).PivotTables("Pivot1")
    .ErrorString = "-"
    .DisplayErrorString = True
End With