Home > Software design >  How make a protect from editing excel file?
How make a protect from editing excel file?

Time:12-19

I create a excel file from a dataframe:

#writer = pd.ExcelWriter('test_1.xlsx', engine='xlsxwriter')    
#uniq_pros.to_excel(writer, sheet_name='Sheet1')
#writer.save()

how can make it protect from editing this excell file? i want be only for view from users...

CodePudding user response:

You can do that as follows using the XlsxWriter worksheet enter image description here

You can also add a password if required.

CodePudding user response:

"Click on the “Review” tab on the main Excel ribbon. Click “Protect Sheet.” Enter the password you would like to use to unlock the sheet in the future. Re-enter the password you made to confirm that you remember it and then click “OK." (in Excel itself) In python you could probably encrypt it: Here are some helpful sources:

https://blog.aspose.com/2021/06/01/encrypt-and-decrypt-excel-files-in-python/

Password Protecting Excel file using Python

https://www.easyxls.com/manual/tutorials/python/protect-excel-sheet-cells.html

  • Related