| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
XL.Book.ErrorCode
Queries the last error code.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| XL | 16.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "XL.Book.ErrorCode"; BookRef ) More
Parameters
| Parameter | Description | Example |
|---|---|---|
| BookRef | The reference number for the workbook. | $ref |
Result
Returns number or error.
Description
Queries the last error code.Possible values:
| Constant | Value | Description |
|---|---|---|
| ERRCODE_OK | 0 | Everything was fine. |
| ERRCODE_INCORRECTPASSWORD | 1 | Incorrect password for encrypted workbook. |
| ERRCODE_ROWOUTOFRANGE | 2 | Row is out of range. |
| ERRCODE_COLOUTOFRANGE | 3 | Column is out of range. |
| ERRCODE_INDEXOUTOFRANGE | 4 | Index is out of range. |
| ERRCODE_INDEXNOSENSE | 5 | Indexes are meaningless for this function. |
| ERRCODE_LASTSHEET | 6 | Workbook must contain at least one visible worksheet. |
| ERRCODE_SHEETNOTFOUND | 7 | Sheet is not found. |
| ERRCODE_NAMECUTOFF | 8 | Name was truncated. |
| ERRCODE_FORMULASYNTAXERROR | 9 | Error in formula expression. |
| ERRCODE_SHEETNAMEINVALID | 10 | Sheet name has an invalid character. |
| ERRCODE_FILENAMEINVALID | 11 | File name can't be NULL. |
| ERRCODE_NAMEALREADYEXIST | 12 | Workbook already contains such a sheet name. |
| ERRCODE_FILENOTAVAILABLE | 13 | Can't open file or path is incorrect. |
| ERRCODE_FILEFORMATNOTSUPPORTED | 14 | File isn't an Excel file or it is not supported. |
| ERRCODE_FUNCNOTSUPPORTEDFORXLS | 15 | This function is not supported for xls files. |
| ERRCODE_FUNCNOTSUPPORTEDFORXLSX | 16 | This function is not supported for xlsx files. |
| ERRCODE_LOADEDONLYINFO | 17 | Only workbook information was loaded. |
| ERRCODE_FONTSIZEOUTOFRANGE | 18 | Font size is out of range. |
| ERRCODE_NOFONTS | 19 | Workbook doesn't have fonts. |
| ERRCODE_STRINGTOOLONG | 20 | String is too long. |
| ERRCODE_STRINGNULL | 21 | String is NULL. |
| ERRCODE_AUTOFILTERNULL | 22 | AutoFilter can't be NULL. |
| ERRCODE_OUTLINELEVELEXCEEDED | 23 | Exceeded outline level for groups. |
| ERRCODE_LOCALEERROR | 24 | Can't apply the specified locale. |
| ERRCODE_XMLERROR | 25 | Workbook is corrupted, error in XML. |
| ERRCODE_BIFFRECERROR | 26 | Workbook is corrupted, error in BIFF record. |
| ERRCODE_IOERROR | 27 | Can't read or write. |
| ERRCODE_CONSISTENCYERROR | 28 | Data inconsistency was found. |
| ERRCODE_OUTOFMEMORY | 29 | Not enough memory. |
| ERRCODE_UNKNOWNSTYLE | 30 | Unknown cell style. |
| ERRCODE_FORMATNULL | 31 | Format is NULL. |
| ERRCODE_FORMATNOTFOUND | 32 | Format is not found. |
| ERRCODE_PARENTFORMATNOTFOUND | 33 | Parent format is not found. |
| ERRCODE_FONTNOTFOUND | 34 | Font is not found. |
| ERRCODE_TABLENOTFOUND | 35 | Table is not found. |
| ERRCODE_RICHSTRINGNOTFOUND | 36 | Rich string is not found. |
| ERRCODE_PROPNOTFOUND | 37 | Property is not found. |
| ERRCODE_UNKNOWNCHAR | 38 | Found an unknown character that can't be processed. |
| ERRCODE_CHARNOTALLOWED | 39 | Some particular symbols are not allowed here. |
| ERRCODE_CELLNOTFOUND | 40 | Cell is not found. |
| ERRCODE_CELLNOTMERGED | 41 | Cell is not in merged cells. |
| ERRCODE_CELLTYPEINCORRECT | 42 | Cell doesn't contain the requested type. |
| ERRCODE_HEIGHTTOOHIGH | 43 | Height is too big. |
| ERRCODE_PICERROR | 44 | Picture is corrupted or it has unknown format. |
| ERRCODE_PICPOSERROR | 45 | Incorrect picture position. |
| ERRCODE_PICNOTFOUND | 46 | Picture is not found. |
| ERRCODE_PICSIZEINCORRECT | 47 | Incorrect picture size. |
| ERRCODE_PICOFFSETEXCEED_XY | 48 | Picture offset_x and offset_y exceed cell's size. |
| ERRCODE_PICOFFSETEXCEED_Y | 49 | Picture offset_y exceeds cell's height. |
| ERRCODE_PICOFFSETEXCEED_X | 50 | Picture offset_x exceeds cell's width. |
| ERRCODE_NOFREECOLORINDEX | 51 | There is no free color index for xls format. |
| ERRCODE_COLORINVALID | 52 | Color is invalid. |
| ERRCODE_PRINTTITLESNOTFOUND | 53 | Print titles are not found. |
| ERRCODE_NAMEDRANGENOTFOUND | 54 | Named range is not found. |
| ERRCODE_NAMEDRANGESKIPPED | 55 | Some parts of named range were skipped. |
| ERRCODE_PAGEBREAKALREADYEXIST | 56 | Page break already exists. |
| ERRCODE_PAGEBREAKNOTFOUND | 57 | Page break is not found. |
| ERRCODE_PAGEBREAKLIMIT | 58 | Number of page breaks exceeds the limit. |
| ERRCODE_IGNOREDERRALREADYEXIST | 59 | Ignored error already exists. |
| ERRCODE_OVERLAP | 60 | Range overlap was detected. |
| ERRCODE_SHEETNOTSPLITTED | 61 | Worksheet is not splitted. |
| ERRCODE_DIRENTRYINCORRECTNAME | 62 | Found an incorrect name in the directory entry inside xls file. |
| ERRCODE_REFINVALID | 63 | Reference has unrecognized format. |
| ERRCODE_REFNOTFOUND | 64 | Reference is not found. |
| ERRCODE_DATEINVALID | 65 | Date is not recognized. |
| ERRCODE_XLSERROR | 66 | XLS file is corrupted. |
| ERRCODE_CONVERROR | 67 | String conversion error, probably incorrect locale. |
| ERRCODE_TOOMANYFORMATS | 68 | Too many cell formats. |
| ERRCODE_TOOMANYFONTS | 69 | Too many fonts. |
| ERRCODE_NOSTYLES | 70 | Styles are not found. |
| ERRCODE_NOID | 71 | ID is not found. |
| ERRCODE_FILTERCOLUMNNULL | 72 | Filter column is NULL. |
| ERRCODE_FILTERVALUENOTFOUND | 73 | Filter value is not found. |
| ERRCODE_FILTERNOTFOUND | 74 | Filter is not found. |
| ERRCODE_DATAVALIDNOTFOUND | 75 | Data validations are not found. |
| ERRCODE_ACTIVECELLNOTFOUND | 76 | Active cell is not found. |
| ERRCODE_HYPERLINKNOTFOUND | 77 | Cell doesn't have a hyperlink. |
| ERRCODE_SORTNOTFOUND | 78 | Sorting in AutoFilter is not found. |
| ERRCODE_CONTROLNOTFOUND | 79 | Control is not found. |
| ERRCODE_AUTOFITERROR | 80 | Can't calculate the cell's width. |
| ERRCODE_VALUEOUTOFRANGE | 81 | Value is out of range. |
| ERRCODE_ZIPERROR | 82 | ZIP library error. |
| ERRCODE_EXCEPTION | 83 | STL exception error. |
| ERRCODE_TRIALLIMIT | 84 | Limitations of the trial version. |
Release notes
- Version 16.1
- Added XL.Book.Clear and XL.Book.ErrorCode functions.
Blog Entries
Created 20th January 2026, last changed 20th January 2026