Make only certain cells of the worksheet protected .
Load this worksheet using openpyxl load_workbook .
Write data to the protected sheet and save it as a new file .
Once you open the new file , in the protected sheet you will observe all cells have now become protected and you can't edit the cells which were unprotected earlier
Steps to replicate :