wb <- wb_load(file = system.file("extdata", "loadExample.xlsx", package = "openxlsx2"))
# testing is the selected sheet
wb_get_selected(wb)
# change the selected sheet to IrisSample
wb <- wb_set_selected(wb, "IrisSample")
# get the active sheet
wb_get_active_sheet(wb)
# change the selected sheet to IrisSample
wb <- wb_set_active_sheet(wb, sheet = "IrisSample")
Run the code above in your browser using DataLab