TRY NEW VERSION

ERROR_TYPE

ERROR_TYPE(arg1) → { number | string | boolean }

Returns a number matching an error value..

Parameters:

Name Type Description
arg1 any

Is the error value for which you want the identifying number, and can be an actual error value or a reference to a cell containing an error value.

Returns:

Type
number | string | boolean

Example

Copy code
builder.CreateFile("xlsx");

const oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
var nonPositiveNum = 0;
var logResult = oFunction.LOG(nonPositiveNum);
oWorksheet.GetRange("B3").SetValue(logResult);
oWorksheet.GetRange("C3").SetValue(oFunction.ERROR_TYPE(logResult));

builder.SaveFile("xlsx", "ERROR_TYPE.xlsx");
builder.CloseFile();

Resulting document