Mar-06-2020, 12:08 PM
Indeed, I misunderstood your question. I was under impression you clear content in cell A1. My bad, sorry.
Now, however, I tried to replicate your problem and was not able to do so. Using openpyxl 2.6.3. Openpyxl correctly detects max row number, regardless how A5 is deleted - select the cell and press Del, drag empty cell from row 6, delete the cell and move cells up, delete entire row, etc.
Are you sure you save the workbook after you delete the A5 cell/content? Make sure you don't have something in rest of the cells...
I doubt excel version will have any effect (i.e. openpyxl does not rely on MS Excel to read the file). different/older openpyxl may be the reason (if there was bug in a version before 2.6.3)
Now, however, I tried to replicate your problem and was not able to do so. Using openpyxl 2.6.3. Openpyxl correctly detects max row number, regardless how A5 is deleted - select the cell and press Del, drag empty cell from row 6, delete the cell and move cells up, delete entire row, etc.
Are you sure you save the workbook after you delete the A5 cell/content? Make sure you don't have something in rest of the cells...
I doubt excel version will have any effect (i.e. openpyxl does not rely on MS Excel to read the file). different/older openpyxl may be the reason (if there was bug in a version before 2.6.3)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs