Get maximum rows containing the data in an excel sheet
defget_maximum_rows(*, sheet_object): rows =0for max_row, row inenumerate(sheet_object, 1):ifnotall(col.value isNonefor col in row): rows +=1return rowsimport openpyxlworkbook = openpyxl.load_workbook('result.xlsx')# <filepath> is the path of the excel filesheet_object = workbook.activemax_rows =get_maximum_rows(sheet_object=sheet_object)