1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrappers.R
\name{replaceStyle}
\alias{replaceStyle}
\title{Replace an existing cell style}
\usage{
replaceStyle(wb, index, newStyle)
}
\arguments{
\item{wb}{A workbook object}
\item{index}{Index of style object to replace}
\item{newStyle}{A style to replace the existing style as position index}
}
\description{
Replace an existing cell style
Replace a style object
}
\examples{
## load a workbook
wb <- loadWorkbook(file = system.file("extdata", "loadExample.xlsx", package = "openxlsx"))
## create a new style and replace style 2
newStyle <- createStyle(fgFill = "#00FF00")
## replace style 2
getStyles(wb)[1:3] ## prints styles
replaceStyle(wb, 2, newStyle = newStyle)
## Save workbook
\dontrun{
saveWorkbook(wb, "replaceStyleExample.xlsx", overwrite = TRUE)
}
}
\seealso{
\code{\link[=getStyles]{getStyles()}}
}
\author{
Alexander Walker
}
|