Error Object and the Errors Collection

The Error object contains one error in the Errors collection representing one error in a cell containing possible errors.

The Errors collection represents all the errors contained within a cell. Each cell can contain multiple errors.

Note that neither the Error nor Errors objects contains a count or Boolean property that would allow you to test whether an error even exists in a cell. For this reason, additional code would be needed to loop through each error type for every desired cell checking for the Error object's Value property, which returns True if that type of error occurs in the cell.

Use the Item property of the Errors Collection object to loop through the error types to determine which errors might have occurred. The Errors Collection object can be used to check for specific error conditions available through xlErrorChecks constants.

0 0

Post a comment