[BUG] WorkbookWriter sheet.protect() function doesn't exist
rheidari opened this issue Β· comments
Reza Heidari commented
π Bug Report
Unable to add cell level protection on worksheet when using the streaming WorkbookWriter due to sheet.protect() not existing in worksheet-writer.js
.
Lib version: 3.9.0
Steps To Reproduce
const workbook = new Excel.stream.xlsx.WorkbookWriter({
filename: './test.xlsx',
});
const sheet = workbook.addWorksheet('data');
const row = sheet.addRow(['readonly cell']);
row.getCell(1).protection = { locked: true };
expect(sheet.protect).to.exist();
await sheet.protect('password');
await workbook.commit();
The expected behavior:
Should create a file that can be opened and 'readonly cell' should have protection.
Possible solution (optional, but very helpful):
Add protect method to worksheet-writer.js
Raeesaa commented
Alan Wang commented
I have approved the fix PR, and wait for other members to review it.
Raeesaa commented
Hi @Alanscut, sorry to bug again about this. Just wanted to know if we have ETA for this as we have first production release next month. And it is important for us to lock excel. If this will take time, we will start working on alternatives. Thank you for the support and great library :)