existsSheet-methods: Checking for existence of worksheets in a workbook

Description Usage Arguments Details Author(s) See Also Examples

Description

Checks the existence of a worksheet in a workbook.

Usage

1
2
## S4 method for signature 'workbook'
existsSheet(object,name)

Arguments

object

The workbook to use

name

The sheet name to check for

Details

Checks if the specified worksheet exists. Returns TRUE if it exists, otherwise FALSE. The name argument is vectorized which allows to check for existence of multiple worksheets with one call.

Author(s)

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

See Also

workbook, createSheet, removeSheet, renameSheet, getSheets, cloneSheet

Examples

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

# Load workbook
wb <- loadWorkbook(demoExcelFile)

# Check for existence of a worksheet called 'mtcars'
existsSheet(wb, "mtcars")

## End(Not run)

Example output

OpenJDK 64-Bit Server VM warning: Can't detect primordial thread stack location - find_vma failed
XLConnect 1.0.1 by Mirai Solutions GmbH [aut],
  Martin Studer [cre],
  The Apache Software Foundation [ctb, cph] (Apache POI),
  Graph Builder [ctb, cph] (Curvesapi Java library)
http://www.mirai-solutions.com
https://github.com/miraisolutions/xlconnect
mtcars 
  TRUE 

XLConnect documentation built on Oct. 1, 2021, 5:06 p.m.