Export an rtable to an Excel spreadsheet - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Input and Output : File Manipulation : ExcelTools : ExcelTools/Export

ExcelTools[Export] - Export an rtable to an Excel spreadsheet

Calling Sequence

Export(R, file, sheet, cell)

Parameters

R

-

rtable ; the rtable to export

file

-

string ; (optional in Standard interface) name of the target file

sheet

-

{string, posint} ; (optional) name or 1-based index of the target sheet within the Excel file (default: 1)

cell

-

string ; (optional) address or name of the cell corresponding to the first position in R (default: "A1")

Description

• 

The Export(R,file,sheet,cell) function exports the rtable R to the Microsoft Excel format file. Both the XLSX (Office Open XML) and XLS (Excel 97-2003) file formats are supported.

• 

If the 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 or 2-dimensional Array.

• 

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.

Examples

R:=Array1..3,1..4,1,2,3,4,5,6,7,8,9,10,11,12

R:=123456789101112

(1)

withExcelTools:

ExportR,Employees.xls,Payroll,B2

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.

ExportR,Employees.xls,Payroll,FirstQuarter

The sheet can be indexed rather than named.  (To perform this example, the file Employee.xls must have a sheet named Sheet2.)

ExportR,Employees.xls,2

(Standard interface only) If the file name is omitted, a dialog opens to request it

ExportR

See Also

Array, ExcelTools, ExcelTools[Import], ExcelTools[WorkbookData], Matrix, rtable, Vector


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam