excel_create creates a new Excel file (Excel 2007).
Return Value
oExcel is a UniScript object of 0 is an error occurred.
Parameters
ssFile is the complete file name. If the file already exists it will be overwriteen.
ssFile is the complete file name. If the file already exists it will be overwriteen.
Example
def test_excel_write()
{
smData = ["Speed", "Torque";
"rpm", "Nm"];
rmData = [1000.0, 10.0;
2000.0, 20.0;
3000.0, 30.0;
4000.0, 40.0;
5000.0, 50.0]
ssExcelFile = "d:/test.xlsx";
oExcel = excel_create(ssExcelFile);
if (type(oExcel) == "error") {
MessageBoxError("Excel-Export\n\n%s\n\nFile: %s", oExcel.message, ssExcelFile);
return FALSE;
}
oSheet = excel_sheet_create(oExcel, "Data1", nr(smData) + nr(rmData), nc(smData));
n = excel_sheet_put_rows(oSheet, smData);
if (type(n) == "error") {
MessageBoxError("Excel-Export\n\n%s\n\nFile: %s", n.message, ssExcelFile);
return FALSE;
}
n = excel_sheet_put_rows(oSheet, rmData);
if (type(n) == "error") {
MessageBoxError("Excel-Export\n\n%s\n\nFile: %s", n.message, ssExcelFile);
return FALSE;
}
}
History
| Version | Description |
|---|---|
| 5.5.0 | New |
See also
id-469683