Is there a way to use Excel's 'Protect Worksheet' and/or 'Protect Workbook' options? #457
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#457
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hey,
Thanks for the awesome work on this library.
I was wondering if you could password protect worksheets and/or workbooks with this library. Or if there was an alternate way which could stop users from being able to modify the structural integrity of an xlsx document?
👍
The protect worksheet options are exposed in the worksheet
!protect
key, as explained in https://github.com/sheetjs/js-xlsx#worksheet-object .The protect workbook option is not currently read or saved. However, if you are feeling adventurous, it's not difficult to add in!
The workbook protection info is stored in a workbookProtection tag. On the write side, it should be placed in the position of the workbookProtection comment.
To stop users from modifying the structure of the workbook, it would suffice to add something like:
where
password
is the password string.If you would like to send a PR, consider adding a
!protect
key to the workbook similar to the sheet object.Protect Worksheet is documented while Protect Workbook will require a Pro build