setActiveSheet-methods: Setting the active worksheet in a workbook

Description Usage Arguments Note Author(s) See Also Examples

Description

Sets the active worksheet of a workbook.

Usage

1
2
3
4
## S4 method for signature 'workbook,character'
setActiveSheet(object,sheet)
## S4 method for signature 'workbook,numeric'
setActiveSheet(object,sheet)

Arguments

object

The workbook to use

sheet

The name or index of the sheet to activate

Note

The active worksheet of a workbook is the worksheet that is displayed when the corresponding Excel file is opened.

Author(s)

Martin Studer
Mirai Solutions GmbH https://mirai-solutions.ch

See Also

workbook, createSheet, removeSheet, renameSheet, existsSheet, getSheets

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# mtcars xlsx file from demoFiles subfolder of package XLConnect
mtcarsFile <- system.file("demoFiles/mtcars.xlsx", package = "XLConnect")

# Load workbook
wb <- loadWorkbook(mtcarsFile)

# Sets the active sheet to the sheet 'mtcars3'
setActiveSheet(wb, sheet = "mtcars3")

## End(Not run)

XLConnect documentation built on April 11, 2021, 9:06 a.m.