I have been working on a project reading Excel files in C#. Sometimes I have had to delete the last few rows from the bottom of the excel sheet but when I do a row count in my code it still thinks these rows exist. If I hover over the whole row, right click and hit delete this will fix the problem, but I am working with multiple spread sheets with many, many lines where the user has already edited this row and just used the delete key. Has anyone else ever had this problem? If so, is there a fix around this?
Share
The problem is that when excel lookup the “last row” it also includes formatted rows. When you delete the rows, the content is deleted but the formatting still exists. I am currently using the following code in my project:
Basically I specifically find the last row without any content in cell(1, 1).