Example of setting Excel worksheet protection.
* Example of cell locking and formula hiding in an Excel worksheet using
* Copyright 2014-2017, John McNamara, email@example.com
/* Widen the first column to make the text clearer. */
(worksheet, 0, 0, 40, NULL);
/* Turn worksheet protection on without a password. */
(worksheet, NULL, NULL);
/* Write a locked, unlocked and hidden cell. */
(worksheet, 0, 0,
"B1 is locked. It cannot be edited."
(worksheet, 1, 0,
"B2 is unlocked. It can be edited."
(worksheet, 2, 0,
"B3 is hidden. The formula isn't visible."
(worksheet, 0, 1,
/* Locked by default. */
(worksheet, 1, 1,
(worksheet, 2, 1,
Copyright 2014-2017 John McNamara. Generated by