I'm a bit impressed because I couldn't find an answer so far.
I have a small R script that is loading data from one source and writing a few dozens Excel files from it. The problem now is: those files need a password protection.
Currently my script is using the XLConnect library to save the excel files. The script is something like this:
# Load data from source
source = <connection string to source>
dataFromSource = <read from source>
# Process
for (data in dataFromSource) {
wb = loadWorkbook( paste("myWorkbook", sourceName, ".xlsx"), create = TRUE)
createSheet(wb, name = "sheet")
<put data into the "sheet">
saveWorkbook(wb)
}
So, making it simple: how do I create an Excel file with password protection in R?