## load existing workbook from package folder
wb <- wb_load(file = system.file("extdata", "loadExample.xlsx", package = "openxlsx2"))
wb$get_sheet_names() # list worksheets
wb ## view object
## Add a worksheet
wb$add_worksheet("A new worksheet")
Run the code above in your browser using DataLab