# NOT RUN {
## load a workbook
wb <- loadWorkbook(file = system.file("extdata", "loadExample.xlsx", package = "openxlsx"))
## Remove sheet 2
removeWorksheet(wb, 2)
## save the modified workbook
# }
# NOT RUN {
saveWorkbook(wb, "removeWorksheetExample.xlsx", overwrite = TRUE)
# }
Run the code above in your browser using DataLab