Skip to content
REFERENCE

U.PROTECT_WORKBOOK

Summary

Protects the structure of the current workbook and cells in all sheets, optionally applying registered lock/hide status to ranges of cells

Syntax

=U.PROTECT_WORKBOOK(protect, [password], [reset_lock_cells], [reset_hide_formulas], [block])

Parameters

Parameter Required Description
protect Yes Set to TRUE to protect the workbook; set to FALSE to unprotect it
[password] No If set when protecting the workbook, the specified password will be required to unprotect it
[reset_lock_cells] No If set to TRUE then all cells in the workbook will be locked except those registered by an U.UNLOCK_CELLS(…) method call
[reset_hide_formulas] No If set to TRUE then all cells in the workbook will be hidden (formulas not shown in formula bar when workbook is protected) unless registered to allow display of formulas in an U.UNLOCK_CELLS(…) method call
[block] No If set to TRUE then method will not be calculated unless triggered by user interaction or calculated as a step in a script; If set to a number then will be throttled to not calculate more frequently than the specified number of seconds; make number negative to prevent auto recalc of blocked methods

Behavior

The documented public interface is supported by the current U Add-in source signature and the maintained Usage Examples workbook. Optional parameters are shown in square brackets in the syntax above; omit the brackets when entering a formula.

Return Value

Returns the function result or action status described by the formula and parameters above. The maintained sources do not define a narrower, stable return contract for this function.

Examples

=U.PROTECT_WORKBOOK(TRUE)

Notes

  • Formula examples are preserved from maintained workbook usage and normalized to the current U. prefix.
  • Complete formulas demonstrate working patterns; they do not imply that undocumented option values are supported.
  • Where maintained sources do not specify every accepted value, default, or error message, this page does not infer one.
  • For functions that perform actions, use a visible trigger or supported block/throttle parameter to avoid unintended repetition during recalculation.