'How to unfreeze excel column using python script

How to unfreeze excel column using python script

wb = load_workbook(excel_file) ws = wb.active ws.freeze_panes = None wb.save(excel_file)

Using above code unfreeze is happening, however If you open processed excel file, the below error is prompted

"we found a problem with some content in excel_file.xlsx. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes"



Solution 1:[1]

Use the code below to avoid this error: "we found a problem with some content in excel_file.xlsx. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes"

ws - worksheet, wb - workbook

ws.sheet_view.selection = [ws.sheet_view.selection[0]] 
ws.sheet_view.selection[0].pane = 'topLeft'
wb.save(excel_file)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 joanis