Dealing with protected sheets

Sep 24, 2009 at 4:03 PM

Hello, I'm having a bit of a problem with dealing with protected sheets. I get an excel file from a 3rd party.  The sheet is protected, which means I cannot insert rows, cannot delete rows, cannot change formatting, etc.

I would like to iterate through a DataTable to fill out this template sheet.  I can do it using sheet.getRow(rownumber) as long as that row has already been hand-editted.  However, once I reach the first row that hasn't, a row that theoritically hasn't been touched, it throws an exception. Same for createRow, throws a "not set to an instance of an object" error.  This has to be because of the protection. 

So my question is, if I can type values into this sheet by hand, manually, why can't i do the same with NPOI?

Sep 25, 2009 at 12:06 AM
Edited Sep 25, 2009 at 12:07 AM

Can you send me the file and a sample to reproduce the issue? Since this file is a bit different from other xls files, I guess the records in it are very different. I'll research the issue.

My email: tonyqus (at)