This function is a wrapper for openxlsx2::wb_save(), but can also open the Excel file immediately after saving. File opening is cross-platform compatible (Windows, macOS, and Linux). If the first sheet is the "info" sheet of create_wb() and there is a second sheet, that second sheet is the active and selected one when the file is opened.

save_wb(
  wb,
  file = here::here("untitled.xlsx"),
  overwrite = FALSE,
  open_after_save = TRUE
)

Arguments

wb

A Workbook object to write to file

file

A character string naming an xlsx file

overwrite

If TRUE, overwrites the previous excel file

open_after_save

If TRUE, opens the excel file after it was created

Value

The file path, invisibly