Mar-05-2020, 11:52 AM
Prepare a spreadsheet with anything in cells A1..A5
Save as 'Myfile.xlsx?
run this code:
Now delete A5 in Myfile and save.
Run again the code.
Answer 5 (not 4). Why?
Save as 'Myfile.xlsx?
run this code:
import openpyxl wb = openpyxl.load_workbook('Myfile.xlsx') sheet = wb.get_sheet_by_name('My sheet') print(sheet.max_row)Answer 5. OK
Now delete A5 in Myfile and save.
Run again the code.
Answer 5 (not 4). Why?