existsCellStyle-methods: Retrieving named cell styles

existsCellStyle-methodsR Documentation

Retrieving named cell styles

Description

Checks whether a named cell style exists in a workbook.

Usage

## 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

## 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)

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