Learn R Programming

openxlsx2 (version 0.6.1)

select_active_sheet: get and set table of sheets and their state as selected and active

Description

Multiple sheets can be selected, but only a single one can be active (visible). The visible sheet, must not necessarily be a selected sheet.

Usage

wb_get_active_sheet(wb)

wb_set_active_sheet(wb, sheet)

wb_get_selected(wb)

wb_set_selected(wb, sheet)

Value

a data frame with tabSelected and names

Arguments

wb

a workbook

sheet

a sheet name of the workbook

Examples

Run this code
  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