This project has moved and is read-only. For the latest updates, please go here.

Ignoring Hidden Rows?

Jul 24, 2012 at 3:30 PM

This seems like a silly question, but when using excel interop it seemed that if i did a calculation that would insert a new row 4 rows from the current row, it would ignore any hidden rows in between the two rows. I.E. would count 4 visible rows before inserting a new one.

it seems that ClosedXML doe the exact opposite and counts all hidden rows as well. Is there any within the library to effectively ignore these hidden rows? or at the least to return a value to indicate whether a row is hidden or not?



Jul 24, 2012 at 4:07 PM

Just find the last visible row and insert 4 rows below it. The behavior you're asking is confusing. If you have a range from row 1-5 where row 5 is hidden and you say range.InsertRowsBelow, it's not intuitive to think that row 5 would be pushed down. You'd first have to check for the visibility every time you're inserting rows and columns just to make sure it will do what you expect it to do.

Jul 24, 2012 at 5:15 PM

Yes I agree it's confusing. Just trying to weigh my options before trying to recreate this horrible spreadsheet by hand so I don;t have to deal with the hidden rows.

Thanks, I appreciate the response.