In the below example, columns A, B will be frozen, and the top 5 rows will be frozen also. Freeze rows and columns by assign the cell name to work_sheet_object‘s freeze_panes attribute.Get the active excel sheet ( worksheet) use Workbook.active attribute.Work_book = load_workbook(excel_file_path, read_only=False) Load the excel file into an openpyxl.Workbook object.How To Freeze Excel Sheet Rows And Columns Use Python Openpyxl.