Skip to contents

wb_add_styles() extends openxlsx2::wb_add_style() by allowing the addition of multiple styles as a named list.

Usage

wb_add_styles(wb, styles, style_names = NULL)

Arguments

wb

A wbWorkbook object.

styles

Required. List or style xml character, created by a ⁠create_*()⁠ function. Passed to style argument of openxlsx2::wb_add_style().

style_names

Optional if styles is a named list.

Value

A wbWorkbook object.

Examples

wb <- openxlsx2::wb_workbook()
wb <- openxlsx2::wb_add_worksheet(wb)

style <- openxlsx2::create_dxfs_style(font_color = openxlsx2::wb_color(hex = "FF0000"))
wb_add_styles(wb, styles = style, style_names = "myred")
#> A Workbook object.
#>  
#> Worksheets:
#>  Sheets: Sheet 1 
#>  Write order: 1