I have been looking at various websites to find a solution of password protect my excel workbook using python but I can't find anything that works. I see couple of solutions where people have protected the file from editing but I need to password protect the entire workbook. Does anyone know how to solve this issue? Here is what I have tried so far but this does not work.
from openpyxl import Workbook
from openpyxl import load_workbook
os.chdir('/Users/Documents')
test_spreadsheet = "ABC.xlsx"
wb = load_workbook(test_spreadsheet)
wb.security.workbookPassword = "password"