# NOT RUN {
## load existing workbook from package folder
wb <- loadWorkbook(file = system.file("extdata", "loadExample.xlsx", package = "openxlsx"))
names(wb) # list worksheets
wb ## view object
## Add a worksheet
addWorksheet(wb, "A new worksheet")
## Save workbook
# }
# NOT RUN {
saveWorkbook(wb, "loadExample.xlsx", overwrite = TRUE)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab