Learn R Programming

XLConnect (version 1.1.0)

setActiveSheet-methods: Setting the active worksheet in a workbook

Description

Sets the active worksheet of a workbook.

Usage

# S4 method for workbook,character
setActiveSheet(object,sheet)
# S4 method for workbook,numeric
setActiveSheet(object,sheet)

Arguments

object

The workbook to use

sheet

The name or index of the sheet to activate

Author

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

See Also

workbook, createSheet, removeSheet, renameSheet, existsSheet, getSheets

Examples

Run this code
if (FALSE) {
# 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")
}

Run the code above in your browser using DataLab