Aller au contenu principal

ExcelGetCellAsError

Structure

ExcelGetCellAsError(iRow,iCol)

Type

Function

Description

This function returns the string representation of an error. It will throw an exception otherwise. Possible results are as follows:

"Null Value"

"Division by 0"

"Invalid Value"

"Invalid or deleted cell reference"

"Invalid name"

"Invalid number"

"Not available"

"Cell not calculated" "Unknown Error"

Parameters: 2

iRow = The row of the cell. 1 is the top row.

iCol = The column of the cell. 1 corresponds to column A

Example

Try

ExcelNewFile(3,"v2003")

ExcelGetSheetByIndex(1)

ShowMessage(ExcelGetCellIsError(1,1)) 'Returns "0"

ExcelSetCellAsFormula(1,1,"=5/0") ' Formula =5/0 will error because of division by 0

ShowMessage(ExcelGetCellAsError(1,1)) 'Returns "Division by 0"

Except

ShowMessage(LastExceptionMessage)

End Try