wb <- wb_workbook()
wb$add_worksheet("S1")
wb_protect(wb, protect = TRUE, password = "Password", lock_structure = TRUE)
# Remove the protection
wb_protect(wb, protect = FALSE)
wb <- wb_protect(
wb,
protect = TRUE,
password = "Password",
lock_structure = TRUE,
type = 2L,
file_sharing = TRUE,
username = "Test",
read_only_recommended = TRUE
)
Run the code above in your browser using DataLab