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