isSheetHidden-methods: Checking if worksheets are hidden in a workbook

isSheetHidden-methodsR Documentation

Checking if worksheets are hidden in a workbook

Description

Checks if the specified worksheets are hidden (but not very hidden) in a workbook.

Usage

## S4 method for signature 'workbook,character'
isSheetHidden(object,sheet)
## S4 method for signature 'workbook,numeric'
isSheetHidden(object,sheet)

Arguments

object

The workbook to use

sheet

The name or index of the sheet to check

Details

Returns TRUE if the specified sheet is hidden (not visible but also not very hidden), otherwise FALSE. sheet is vectorized such that multiple worksheets can be queried with one method call. An exception is thrown if the specified sheet does not exist.

Author(s)

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

See Also

workbook, hideSheet, unhideSheet, isSheetVeryHidden, isSheetVisible

Examples

## Not run: 
# Load workbook (create if not existing)
wb <- loadWorkbook("isSheetHidden.xlsx", create = TRUE)

# Write a couple of built-in data.frame's into sheets
# with corresponding name
for(obj in c("CO2", "airquality", "swiss")) {
  createSheet(wb, name = obj)
  writeWorksheet(wb, get(obj), sheet = obj)
}

# Hide sheet 'airquality'
hideSheet(wb, sheet = "airquality")

# Check if sheet 'airquality' is hidden;
# this should obviously return TRUE
isSheetHidden(wb, "airquality")

# Check if sheet 'swiss' is hidden;
# this should obviously return FALSE
isSheetHidden(wb, "swiss")


# clean up 
file.remove("isSheetHidden.xlsx")

## End(Not run)

miraisolutions/xlconnect documentation built on April 19, 2024, 2:40 p.m.