Known Exceptions Details in Excel Library
8 Dec 202324 minutes to read
The list of known exceptions thrown in Essential XlsIO is listed below.
ApplicationException
Class |
Message |
Reason |
Workbook | "Workbook was not created from file." + " That is why workbook file not specified." + " You must use SaveAs method instead." | The file name cannot be empty |
Worksheet | "Can't deselect all worksheets." | Can't deselect all worksheets |
"Can't find data for MSODrawing" | The value of current mso index cannot greater than array drawings count | |
"Sheet is already protected, before use unprotect method" | The property is true the sheet is already protected | |
"You cannot use this command on a protected sheet | The condition is false you cannot use this command on protected sheet |
ArgumentException
Class |
Message |
Reason |
Pictures | string cannot be empty. | Valid filename of the image must be provided. |
Shape | From center style support only var_1 or var_2 | From center style support only var_1 or var_2 |
strName cannot be null or empty. | String cannot be empty | |
strShapeName - string cannot be empty. | String cannot be empty | |
The rotation value should be between -3600 and 3600 | The rotation value should be between -3600 and 3600 | |
Name cannot be null or empty | Name of the UserPicture cannot be empty. | |
Path cannot be null or empty | Path of the UserPicture cannot be null or empty. | |
Path cannot be null or empty | Path of the UserTexture cannot be empty. | |
Shape name cannot be null. | Valid name is not found for the shape. | |
The specified value is out of range | TextureHorizontalScale must be >= 21475. | |
The specified value is out of range | TextureOffsetX must be >= 169056. | |
The specified value is out of range | TextureOffsetY must be >= 169056. | |
The specified value is out of range | TextureVerticalScale must be >= 21475. | |
This method supports only preset textured | Custom gradient texture does not support. | |
TransparencyColor | The TransparencyFrom on shape should not be less than 0 and greater than 1. | |
TextBox | "Reference is not valid | The value of the string index 0 is equal to "=" the reference is not valid |
Workbook | "Can't refer to external worksheets" | Cannot refer to external workbook |
"FileName cannot be empty." | The file name cannot be empty | |
"fileName" | String cannot be empty | |
"name" | String cannot be empty | |
"Names array must contain at least one name." | Names array must contain at least one name | |
"separator" | String cannot be empty | |
"strFileName - string cannot be empty." | String cannot be empty | |
"strName - string cannot be empty" | String cannot be empty | |
"strSheetName" | String cannot be empty | |
"Workbook is protected and password wasn't specified." | Workbook is protected and password wasn't specified | |
"Contains invalid characters | Contains invalid characters | |
"FileName cannot be empty. | The file name cannot be empty | |
Worksheet | "arrDataColumns can't be empty" | String cannot be empty |
"Cannot sets formula value in cell that doesn't contain formula" | Cannot sets formula value in cell that doesn't contain formula | |
"Can't insert column" | Cannot insert column given condition is false | |
"Can't insert row" | Cannot insert row given condition is true | |
"cellFormat" | The array extend formats count is not less than cell format index value | |
"defaultStyle" | The XF index value is not equal to minimum value of the integer | |
"Each range argument should contain a single cell" | Each range argument should contain a single cell | |
"FileName cannot be empty." | File name cannot be empty | |
"Image Path doesn't exist" | Image path does not exist | |
"Ranges do not fit each other" | The Ranges do not fit each other | |
"separator" | String cannot be null or empty | |
"strName - string cannot be empty." | String cannot be empty | |
"Workbook at least must contains one worksheet. You cannot remove last worksheet.", "sheet" | Workbook at least must contain one worksheet. You cannot remove last worksheet | |
"Workbook must contains at least one worksheet. You cannot remove last worksheet.", "sheet" | Workbook must contain at least one worksheet. You cannot remove last worksheet | |
"Invalid column index. | The column index is not less than 0 and greater than 0x3fff | |
"Invalid row index. | The row index is not less than 0 and greater than 0xfffff | |
"separator | String cannot be empty | |
Sheet Name is InValid | Sheet Name is InValid |
ArgumentNullException
Class |
Message |
Reason |
Workbook | "Name can't be NULL." | Name can't be NULL |
"separator" | The string cannot be empty | |
"styleIndexes" | The style index is not equal to null | |
"password | String cannot be empty | |
Worksheet | "Conditions" | The condition property is not null and CFExRecords property is not equal to null |
"firstColumn" | The column index value is not equal to 0 and greater than book maximum column count | |
"password" | The string cannot be empty | |
"separator" | String cannot be empty | |
"dataSource | String cannot be empty |
ArgumentOutOfRangeException
Class |
Message |
Reason |
PageSetup | Parts array must have only three elements. | The header/footer string should have 3 parts. |
The string is too long. Reduce the number of characters used. | The header/footer value exceeds the characters limit. | |
Zoom value must be between 10 and 400 percent. | The zoom value in page setup should me within the given limit. | |
Shape | BottomRowOffset | The BottomRowOffset should not be less than 0. |
Height | The Height should not be less than 0. | |
iColumn1 | The column should not be less than 1 and greater than maximum column count. | |
iColumn2 | The column should not be less than 1 and greater than maximum column count. | |
iPixels | The pixels should not be less than 0 and greater than row height. | |
Can't be less than zero. | The iPixels should not be less than 0. | |
iRow1 | The row value should not be less than 1 and greater than maximum row count. | |
iRow2 | The row value should not less than 1 and greater than maximum row count. | |
LeftColumnOffset | The LeftColumnOffset should not be less than 0. | |
RightColumnOffset | The RightColumnOffset should not be less than 0. | |
scaleHeight | The ScaleHeight should not be less than 0. | |
scaleWidth | The ScaleWidth should not be less than 0. | |
TopRowOffset | The TopRowOffset should not be less than 0. | |
Value | The Transparency should not be less than 0 and greater than 1. | |
Weight | The Weight should not be less than 0 and greater than maximum line weight value. | |
Width | The Width should not be less than 0. | |
iPixels can't be less than zero. | The iPixels should not be less than 0 | |
Gradient degree is out of range | The gradient range should not be less than -1 and greater than 1. | |
Transparency | The Transparency on shape should not be less than 0 and greater than 1. | |
TransparencyFrom | The TransparencyFrom value on shape should not be less than 0 and greater than 1. | |
TransparencyTo | The TransparencyTo value on shape should not be less than 0 and greater than 1. | |
Workbook | "ActiveSheetIndex" | The sheet value is not less than 0 and greater than list object count |
"Array cannot contain more than 4 selection records" | Array cannot contain more than 4 selection records | |
"DisplayedTab", "Displayed tab must be greater than zero and less than Worksheets count" | Displayed tab must be greater than zero and less than Worksheets count | |
"fileName" | The file name cannot be empty | |
"fullName" | String cannot be empty | |
"index" | Value cannot be less than 0 and greater than Count | |
"index", "Index cannot be less than 0 and larger than Palette colors array size." | Index cannot be less than 0 and larger than Palette colors array size | |
"index", "Value cannot be less than 0 and greater than Count - 1." | Value cannot be less than 0 and greater than Count - 1 | |
"iRef" | The reference index value is not less than or equal to extern sheet reference and less than 0; | |
"iReferenceIndex", "Value cannot be less than 0 and greater than arrRefs.Count - 1" | Value cannot be less than 0 and greater than arrRefs.Count - 1 | |
"iStartIndex" | The start index value is not less than stro0 and greater than color count | |
"maxCount" | The XF index value is not less than or equal to 0 | |
"PasswordToOpen", "Password too long. Maximum password length is 15 characters." | Password too long. Maximum password length is 15 characters | |
"referenceIndex", "Value cannot be less than 0 and greater than arrRefs.Count - 1" | Value cannot be less than 0 and greater than arrRefs.Count - 1 | |
"sheetsQuantity", "Quantity of worksheets must be greater than zero." | Quantity of worksheets must be greater than zero | |
string.Format( "index is {0}, Count is {1}", index, List.Count) | Index value is not less than 0 and not greater than equal to list count | |
string.Format("index is {0}, Count is {1}", index, count) | Index value is not less than 0 and not greater than equal to list count | |
Worksheet | "Apostrophe can't be used as first and/or last character of the worksheet's name." | Apostrophe can't be used as first and/or last character of the worksheet's name |
"Chart index" | Index value is not less than 0 and not greater than equal to list count | |
"column index" | The column index value is not equal to 0 and greater than book maximum column count | |
"Column", "Column index cannot be larger then 256 or less then one" | Column index cannot be larger than 256 or less than one | |
"columnIndex", "Value cannot be less than 0 and greater than 255" | Value cannot be less than 0 and greater than 255 | |
"count" | The count is not less than 0 | |
"drawingItemName" | The string name cannot be empty | |
"firstColumn" | The column index value is not equal to 0 and greater than book maximum column count | |
"firstRow" | The row index value is not equal to 0 and greater than book maximum rows count | |
"iColumn can't be less than 1" | iColumn can't be less than 1 | |
"iColumnCount", "Value cannot be less 1 and greater than max column index" | Value cannot be less 1 and greater than max column index | |
"iColumnIndex", "Column index is out of range." | Column index is out of range | |
"iColumnIndex", "Value cannot be less 1 and greater than max column index." | Value cannot be less 1 and greater than max column index. | |
"iColumnIndex", "Value cannot be less than 1 and greater than m_book.MaxColumnCount." | Value cannot be less than 1 and greater than m_book.MaxColumnCount | |
"iCondFmtPos" | The index value is not less than 0 | |
"iCustomPropertyPos" | Index value is not less than 0 and not greater than equal to list count | |
"iDValPos" | The integer value is not less than 0 | |
"index < 0" | The index value is not less than 0 | |
"index" | Index value is not less than 0 and not greater than equal to list count | |
"index", "Value cannot be less than 0 and greater than Count - 1." | Value cannot be less than 0 and greater than Count - 1 | |
"iNewIndex" | Index value is not less than 0 and not greater than equal to list count | |
"iOldIndex" | Index value is not less than 0 and not greater than equal to list count | |
"iRowIndex" | The row index value is not equal to 0 and greater than book maximum rows count | |
"iRowIndex", "Value cannot be less 1 and greater than max row index." | Value cannot be less 1 and greater than max row index | |
"iRowIndex", "Value cannot be less than 1 and greater than m_book.MaxColumnCount." | Value cannot be less than 1 and greater than m_book.MaxColumnCount | |
"iSSTIndex" | The shared string index value is not less than 0 or greater than book inner shared string count | |
"iStartIndex" | The index value is not less than 0 | |
"Length of the password can't be more than " + DEF_MAX_PASSWORDLEN | The password length value is greater than default maximum password length | |
"maxCount" | The index value is not less than or equal to 0 | |
"range" | The range of the row and column is not equal to range of the last column and last row | |
"rowIndex" | The row index value is not less than 1 and greater than book maximum count | |
"Standard Row Height" | The standard row height value is not less than 0 | |
"Text value cannot be null or empty" | Text value cannot be null or empty | |
"Text value cannot be null or empty. First symbol must be '#'" | Text value cannot be null or empty. First symbol must be '#' | |
"Text value cannot be null or empty. First symbol of formula cannot be '='" | Text value cannot be null or empty. First symbol of formula cannot be '=' | |
"Value cannot be less 1 and greater than max column index." | Value cannot be less 1 and greater than maximum column index | |
"Value does not valid error string." | Given value does not contains dictionary | |
"Worksheets collection does not contain specified worksheet." | Worksheets collection does not contain specified worksheet | |
"Zoom", "Zoom must be in range from 10 till 400." | Zoom must be in range from 10 till 400. | |
strParentItemName | The string name cannot be empty | |
Column value cannot be less than 0 and greater than 255 | Value cannot be less than 0 and greater than 255 | |
End Row Index cannot be greater than max row index | Value cannot be greater than max row index | |
firstColumn | The column index value is not equal to 0 and greater than book maximum column count | |
firstRow | The row index value is not equal to 0 and greater than book maximum rows count | |
Length of the password can't be more than password length | The password length value is greater than default maximum password length | |
Row Index value cannot be less than 1 and greater than max row index | The row index value is not equal to 0 and greater than book maximum rows count | |
Standard Column Width. | The standard column width value is not less than 0 and greater than default maximum column width | |
Value cannot be less 1 and greater than max column index. | Value cannot be less 1 and greater than max column index | |
Value cannot be less 1 and greater than max row index. | Value cannot be less 1 and greater than max row index | |
Value must be 0 to 3 | Value must be 0 to 3 | |
string.Format("index is {0}, Count is {1}", index, List.Count) | Index value is not less than 0 and not greater than equal to list count |
ExcelWorkbookNotSavedException
Class |
Message |
Reason |
Workbook | "Object cannot be disposed." + " Save workbook or set property ThrowNotSavedOnDestroy to false. | Save workbook or set property ThrowNotSavedOnDestroy to false |
FileNotFoundException
Class |
Message |
Reason |
Shape | File represents by current path doesn't exist | File represents by current path doesn't exist. |
Workbook | "File could not be found. Please verify the file path." | "File could not be found. |
string.Format("File {0} could not be found. Please verify the file path.", filename) | The file name is not there in given file path the exception will throw |
InvalidRangeException
Class |
Message |
Reason |
Worksheet | Can't copy to destination range | The destination array formula not separator the cannot copy to destination range |
NotSupportedException
Class |
Message |
Reason |
Shape | This property can be set only when Gradient Style is selected. | This property can be set only when Gradient Style is selected. |
This property supports only if pattern style is checked | This property supports only if pattern style is checked. | |
This property supports only if pattern style is checked | This property supports only if texture style is checked. | |
This property support only if defined user texture of picture | This property support only if defined user texture of picture. | |
"This property supports only if Checked Solid style." | This property supports only if Solid style is checked | |
"This shape doesn't support fill properties." | The m_bSupportOption is false the fill format not supported | |
"This shape doesn't support line properties." | The m_bSupportOption is false the line format not supported | |
HyperLink | The shape is not equal to AutoShape, picture, textbox does not supported in hyperlink | |
This property supported only if checked preset color type | Supports only Excel gradient preset. | |
This property supports only if checked one color gradient | Supports only Excel gradient preset. | |
This variant doesn't support center shading style. | The shape object doesn't support center shading style. | |
Workbook | "Name of worksheet must be unique in a workbook." | Name of worksheet must be unique in a workbook |
"Not supported encryption type." | This property is not supported for encryption type | |
"Weak encryption algorithm is not supported." | Weak encryption algorithm is not supported. | |
Worksheet | Name of worksheet must be unique in a workbook | Name of worksheet must be unique in a workbook |