addWorksheet: Add a new worksheet to an Excel document

addWorksheetR Documentation

Add a new worksheet to an Excel document

Description

This function and its methods allow one to create a new worksheet within an Excel workbook.

Usage

addWorksheet(doc, name = sprintf("Sheet%d", num), data = NULL,
               update = TRUE, num = getNextSheetNumber(doc))

Arguments

doc

the Excel archive

name

the name to use in the tab for the new sheet

data

currently ignored. This is could be a data frame which would then be added to

update

a logical value indicating whether to write the changes to the Excel archive.

num

the new total number of worksheets.

Value

If update is TRUE, this returns a Worksheet object representing the new work sheet.

If update is FALSE, the updated XML documents are returned as a named list. These can then be inserted later into the archive.

Author(s)

Duncan Temple Lang

References

Office Open documentation

See Also

Worksheet-class


duncantl/RExcelXML documentation built on Nov. 23, 2023, 4:21 p.m.