Get and set active sheet of the workbook
activeSheet(wb)
activeSheet(wb) <- value
return the active sheet of the workbook
wb <- createWorkbook()
addWorksheet(wb, sheetName = "S1")
addWorksheet(wb, sheetName = "S2")
addWorksheet(wb, sheetName = "S3")
activeSheet(wb) # default value is the first sheet active
#> [1] 1
activeSheet(wb) <- 1 ## active sheet S1
activeSheet(wb)
#> [1] 1
activeSheet(wb) <- "S2" ## active sheet S2
activeSheet(wb)
#> [1] 2