Checks the existence of a name in a workbook
.
# S4 method for workbook
existsName(object, name)
The workbook
to use
The name to check for
Martin Studer
Mirai Solutions GmbH https://mirai-solutions.ch
Returns TRUE
if the specified name
exists and FALSE
otherwise. Note that the name
argument is vectorized and
therefore multiple names can be checked for existence in one method call.
workbook
, createName
, removeName
,
getDefinedNames
, readNamedRegion
,
writeNamedRegion
if (FALSE) {
# mtcars xlsx file from demoFiles subfolder of package XLConnect
mtcarsFile <- system.file("demoFiles/mtcars.xlsx", package = "XLConnect")
# Load workbook
wb <- loadWorkbook(mtcarsFile)
# Check if the name 'mtcars' exists
# (should return TRUE since the name is defined as 'mtcars!$A$1:$K$33')
existsName(wb, name = "mtcars")
}
Run the code above in your browser using DataLab