Open supermonkeybrainz opened 6 months ago
Allows you to do stuff like this:
const styles = {
// Create a reusable style
unlocked: workbook.createStyle({
protection: { hidden: false, locked: false },
}),
};
worksheet
.cell(1, 1)
.string(`test`)
.style(styles.unlocked);
Then you can lock the sheet like this:
const worksheetOptions = {
sheetProtection: { objects: true, scenarios: true, sheet: true },
};
const worksheet = workbook.addWorksheet('Test', worksheetOptions);
This adds the
protection
option to styles for cells. This allows users to lock specific cells. There are other protection options, but this is a good start.