Save a workboook object to file while filling file name from assigned workbook title
Source:R/wb_save.R
wb_save_ext.Rdwb_save_ext() is a helper function extending openxlsx2::wb_save() by
filling a missing file name with the workbook title and validating the file
extension. This function is not stable and may change in the future.
Arguments
- wb
A
wbWorkbookobject to write to file- file
A path to save the workbook to
- overwrite
If
FALSE, will not overwrite whenfilealready exists.- ...
Arguments passed on to
openxlsx2::wb_savepathDeprecated argument. Please use
filein new code.flushExperimental, streams the worksheet file to disk
Examples
withr::with_tempdir({
wb <- wb_new_workbook(
title = "Title used for output file",
sheet_name = "Sheet 1"
)
wb_save_ext(wb)
fs::dir_ls()
})
#> Title used for output file.xlsx