## load existing workbook from package folder
wb <- wb_load(file = system.file("extdata", "openxlsx2_example.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