No FileSharing saved with workbook properties
Hi,
I was looking for a way to recommend Read-Only at file opening. I found nothing in the documentation (only access password, and usual protection). So I looked into the FileSharing object (workbook.protection) and I found a certain number of features (password for modification) but it seems it's not saved at the end.
from openpyxl import Workbook
from openpyxl.workbook.protection import FileSharing
wb = Workbook()
wb.fileSharing = FileSharing(readOnlyRecommended=True)
wb.save('test.xlsx')
This does not prompt a Read-Only message at opening (usual file opening).
But this seems to do the trick :
add self.package.fileSharing = wb.fileSharing
here : https://foss.heptapod.net/openpyxl/openpyxl/-/blob/branch/3.0/openpyxl/workbook/_writer.py#L53.
Is this the right way to do it ? Are there some other problems related to this ?
I'm working on version 3.0.5 of openpyxl.
Thanks,
JC