Learn R Programming

XLConnect (version 0.1-3)

saveWorkbook-methods: Saving Microsoft Excel workbooks

Description

Saves a workbook to the corresponding Excel file. This method actually writes the workbook object to disk.

Usage

## S3 method for class 'workbook':
saveWorkbook(object)

Arguments

object
The workbook to save

Details

Saves the specified workbook object to disk. The workbook's underlying filename specifies the path (see the workbook class for more information).

See Also

workbook, loadWorkbook

Examples

Run this code
# Create a new workbook 'saveMe.xlsx'
# (assuming the file to not exist already)
wb <- loadWorkbook("saveMe.xlsx", create = TRUE)

# Create a worksheet called 'mtcars'
createSheet(wb, name = "mtcars")

# Write built-in dataset 'mtcars' to sheet 'mtcars' created above
writeWorksheet(wb, mtcars, sheet = "mtcars")

# Save workbook - this actually writes the file 'saveMe.xlsx' to disk
saveWorkbook(wb)

Run the code above in your browser using DataLab