hideSheet-methods

0th

Percentile

Hiding worksheets in a workbook

(Very) hides the specified worksheets in a '>workbook.

Keywords
methods, utilities
Usage
# S4 method for workbook,character
hideSheet(object, sheet, veryHidden)
# S4 method for workbook,numeric
hideSheet(object, sheet, veryHidden)
Arguments
object

The '>workbook to use

sheet

The name or index of the sheet to hide

veryHidden

If veryHidden = TRUE, the specified sheet is "very" hidden (see note), otherwise it is just hidden. Default is FALSE.

Details

The arguments sheet and veryHidden are vectorized such that multiple worksheets can be (very) hidden with one method call. An exception is thrown if the specified sheet does not exist.

Note

Note that hidden worksheets can be unhidden by users directly within Excel via standard functionality. Therefore Excel knows the concept of "very hidden" worksheets. These worksheets cannot be unhidden with standard Excel functionality but need programatic intervention to be made visible.

Also note that in case the specified worksheet to hide is the currently active worksheet, then hideSheet tries to set the active worksheet to the first non-hidden (not hidden and not very hidden) worksheet in the workbook. If there is no such worksheet, hideSheet will throw an exception.

See Also

'>workbook, unhideSheet, isSheetHidden, isSheetVeryHidden, isSheetVisible

Aliases
  • hideSheet
  • hideSheet-methods
  • hideSheet,workbook,character-method
  • hideSheet,workbook,numeric-method
Examples
# NOT RUN {
# Load workbook (create if not existing)
wb <- loadWorkbook("hiddenWorksheet.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';
# the sheet may be unhidden by a user from within Excel
# since veryHidden defaults to FALSE
hideSheet(wb, sheet = "airquality")

# Save workbook
saveWorkbook(wb)
# }
Documentation reproduced from package XLConnect, version 0.2-14, License: GPL-3

Community examples

Looks like there are no examples yet.