Append (-APPEND) command

Append to an existing workbook. This command is optional. Use this command for data targets.

-A append or (-APPEND append).

This option is not applicable when using a template.

By using append, if a workbook already exists, a new worksheet can be appended instead of overwriting it. However, if the user selects a pre-existing worksheet in that workbook to be written to, it is overwritten even if append mode is selected. It works for both file and memory operations.

Examples

PUT example (file-based):
=PUT("EXCEL", "-FILE file1.xlsx -WRKSHEET sheet2 -A", in)
This will append a new Sheet, sheet2, to the Workbook file1.xlsx, with the data parsed from the input. If file1.xlsx doesn't already exist, so it will create a new one and add sheet2 to it.
PUT example (memory-based):
=PUT("EXCEL", "-FILE memory://docInMemory -WRKSHEET sheet2 -APPEND", in)

This will append a new Sheet sheet2 to the document docInMemory stored in memory, with the data parsed from input in . If docInMemory doesn't already exist, it will result in a document not found error.