qprotect | R Documentation |
Wrapper to openxlsx::protectWorksheet
with additional argument cols
to
enable protection to be limited to specific columns.
In practice, protection is first applied to the entire worksheet, and then subsequently columns not selected for protection (if any) are unlocked one by one. This unlock step (when relevant) also requires a row specification, which by default we limit to the range of the current data. Thus, in 'unprotected' columns within protected worksheets, rows beyond the range of the data will remain protected. As a hack to work around this, the user can specify a 'buffer' of additional empty rows to unprotect within each non-protected column (e.g. to allow further data entry).
qprotect(
password = NULL,
cols = everything(),
row_buffer = 0L,
protect = TRUE,
lockSelectingLockedCells = FALSE,
lockSelectingUnlockedCells = FALSE,
lockFormattingCells = FALSE,
lockFormattingColumns = FALSE,
lockFormattingRows = FALSE,
lockInsertingColumns = TRUE,
lockInsertingRows = TRUE,
lockInsertingHyperlinks = FALSE,
lockDeletingColumns = TRUE,
lockDeletingRows = TRUE,
lockSorting = FALSE,
lockAutoFilter = FALSE,
lockPivotTables = NULL,
lockObjects = NULL,
lockScenarios = NULL
)
password |
(optional) password required to unprotect the worksheet |
cols |
Tidy-selection specifying the columns that protection should
apply to. Defaults to |
row_buffer |
The number of additional rows (beyond the range of the
current data) to unprotect within columns not specified in argument |
protect |
Whether to protect or unprotect the sheet (default=TRUE) |
lockSelectingLockedCells |
Whether selecting locked cells is locked |
lockSelectingUnlockedCells |
Whether selecting unlocked cells is locked |
lockFormattingCells |
Whether formatting cells is locked |
lockFormattingColumns |
Whether formatting columns is locked |
lockFormattingRows |
Whether formatting rows is locked |
lockInsertingColumns |
Whether inserting columns is locked |
lockInsertingRows |
Whether inserting rows is locked |
lockInsertingHyperlinks |
Whether inserting hyperlinks is locked |
lockDeletingColumns |
Whether deleting columns is locked |
lockDeletingRows |
Whether deleting rows is locked |
lockSorting |
Whether sorting is locked |
lockAutoFilter |
Whether auto-filter is locked |
lockPivotTables |
Whether pivot tables are locked |
lockObjects |
Whether objects are locked |
lockScenarios |
Whether scenarios are locked |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.