wb <- wb_workbook()
wb$add_worksheet("S1")
wb$add_data_table(1, x = iris[1:30, ])
wb$protect_worksheet(
"S1",
protect = TRUE,
properties = c("formatCells", "formatColumns", "insertColumns", "deleteColumns")
)
# Formatting cells / columns is allowed , but inserting / deleting columns is protected:
wb$protect_worksheet(
"S1",
protect = TRUE,
c(formatCells = FALSE, formatColumns = FALSE,
insertColumns = TRUE, deleteColumns = TRUE)
)
# Remove the protection
wb$protect_worksheet("S1", protect = FALSE)
Run the code above in your browser using DataLab