getOrCreateCellStyle-methods
From XLConnect v1.0.1
by Martin Studer
Retrieving or creating named cell styles
Usage
# S4 method for workbook,character
getOrCreateCellStyle(object,name)
Arguments
Details
Retrieves an existing '>cellstyle
if it exists or creates a new one if it
does not exist yet.
See Also
'>workbook
, '>cellstyle
, setCellStyle
,
createCellStyle
, existsCellStyle
Examples
# NOT RUN {
# Load workbook (create if not existing)
wb <- loadWorkbook("getOrCreateCellStyle.xlsx", create = TRUE)
# The first time, the style does not exist yet and gets created
myStyle <- getOrCreateCellStyle(wb, name = "MyStyle")
# The second time, we retrieve the already existing style
myStyle <- getOrCreateCellStyle(wb, name = "MyStyle")
# clean up
file.remove("getOrCreateCellStyle.xlsx")
# }
Community examples
Looks like there are no examples yet.