export an rtable to an Excel spreadsheet
Export(R, file, sheet, cell)
Array, Matrix, Vector, or DataFrame ; object containing data to export
string ; (optional in Standard interface) name of the target file
string or posint ; (optional) name or 1-based index of the target sheet within the Excel file (default: 1)
string ; (optional) address or name of the cell corresponding to the first position in R (default: "A1")
The Export(R,file,sheet,cell) function exports the container R to the Microsoft Excel format file. Both the XLSX (Office Open XML) and XLS (Excel 97-2003) file formats are supported.
If the named file file does not exist, it will be created. By default, the file is saved in your installation directory. The data in R will be written to the worksheet specified by sheet (which defaults to 1 if not specified), with the first (in the case of a 1-dimensional rtable) or top-left (in the case of a 2-dimensional rtable) entry in R being written to the cell location specified by cell.
In the Standard interface, if the file parameter is not provided, a dialog will be presented with a field for the target file name. In all other interfaces, the file parameter is required.
The cell parameter can be a standard Excel cell reference (for example, "A1", "$b10") or a named cell location. In the latter case, the file must already exist and the specified name must refer to a defined name in that Excel spreadsheet.
If the cell parameter is given as a name or cell range, a warning will be displayed if the corresponding cell range is not of the same dimensions as the rtable R. The export operation will still be performed.
The entries in R will be written to locations in the target which correspond to their locations in R. For example, if R is an rtable with 2 rows and 3 columns and the target cell is "B2", then the 3rd entry in the 2nd row of R will be written to cell "C4".
If R is a Vector, its orientation will be respected in the target file.
If R is a 1-dimensional Array, it will be exported to a column in the target file.
Otherwise, R can be a Matrix, 2-dimensional Array, or DataFrame.
If the export operation will result in data in the target file being overwritten, a warning will be displayed, but the operation will be performed.
R ≔ Array⁡1..3,1..4,1,2,3,4,5,6,7,8,9,10,11,12
The destination cells can be specified via a name
Note: To perform the next example, you should first create an Excel spreadsheet named Employees.xls with a sheet named Payroll and cell named FirstQuarter.
The sheet can be indexed rather than named. (To perform this example, the file Employees.xls must have a sheet named Sheet2.)
(Standard interface only) If the file name is omitted, a dialog opens to request it
Download Help Document