existsCellStyle-methods: Retrieving named cell styles

Description Usage Arguments Details Author(s) See Also Examples

Description

Checks whether a named cell style exists in a workbook.

Usage

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

Arguments

object

The workbook to use

name

The name of the cellstyle to check

Details

Checks whether the cellstyle with the specified name exists.

Author(s)

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

See Also

workbook, cellstyle, setCellStyle, createCellStyle, getOrCreateCellStyle

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# Load workbook (create if not existing)
wb <- loadWorkbook("existsCellStyle.xlsx", create = TRUE)

# Cell style 'MyStyle' does not exist yet
stopifnot(!existsCellStyle(wb, "MyStyle"))

# Create the style "MyStyle"
createCellStyle(wb, "MyStyle")

# And now it is here
stopifnot(existsCellStyle(wb, "MyStyle"))

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

## End(Not run)

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