Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "row cannot be less than 1" while using 'InsertRow' in version 4.1.0 when worksheet has broken reference in NamedRange #9

Closed
tahir9489 opened this issue Aug 17, 2017 · 1 comment

Comments

@tahir9489
Copy link

Our project is upgraded from 4.0.5 to 4.1.0 and noticed this error
The following code results in exception "row cannot be less than 1"

int xlRow = 18;
using (ExcelPackage xl = new ExcelPackage(pfReport, template))
{
var wb = xl.Workbook;
ExcelWorksheet sht = wb.Worksheets[1];
--> sht.InsertRow(xlRow, 1);
xl.Save();
}

Note that the template file contains text in cells below row 18

When rolling back to version 4.0.5 the code runs normally

Comments: In our case in turned out that it was an invalid NamedRange in the Excel template. You can check this by hitting CTRL+F3 in Excel. Search for #REF! in Value column. After deleting this NamedRange the problem was solved. Error message is misleading because it suggests your parameters are invalid.

@pruiz
Copy link
Owner

pruiz commented Aug 17, 2017

I am sorry, but this is not EEPlus' oficial repository, but my own fork with misc changes.

@pruiz pruiz closed this as completed Aug 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants