Learn R Programming

openxlsx2 (version 1.4)

wb_save: Save a workbook to file

Description

Save a workbook to file

Usage

wb_save(wb, file = NULL, overwrite = TRUE, path = NULL)

Value

the wbWorkbook object, invisibly

Arguments

wb

A wbWorkbook object to write to file

file

A path to save the workbook to

overwrite

If FALSE, will not overwrite when file already exists.

path

Deprecated argument. Please use file in new code.

See Also

Other workbook wrappers: base_font-wb, col_widths-wb, creators-wb, grouping-wb, row_heights-wb, wb_add_chartsheet(), wb_add_data(), wb_add_data_table(), wb_add_formula(), wb_add_pivot_table(), wb_add_slicer(), wb_add_worksheet(), wb_base_colors, wb_clone_worksheet(), wb_copy_cells(), wb_freeze_pane(), wb_merge_cells(), wb_set_last_modified_by(), wb_workbook()

Examples

Run this code
## Create a new workbook and add a worksheet
wb <- wb_workbook("Creator of workbook")
wb$add_worksheet(sheet = "My first worksheet")

## Save workbook to working directory
# \donttest{
wb_save(wb, file = temp_xlsx(), overwrite = TRUE)
# }

Run the code above in your browser using DataLab