excel_openΒΆ

excel_open opens an Excel file for reading.

oExcel = excel_open(ssFile)

Return Value

oExcel is an UniScript object or 0 if an error occurred.

Parameters

ssFile

ssFile is the complete file name.

Comment

To close the Excel file invoke excel_close.

Example

def MyExcelRead(ssName)
{
    oExcel = excel_open(ssName);
    if (oExcel == 0) {
        MessageBoxError("Cannot open file %s", ssName);
        return "";
    }
    oSheet = excel_sheet_open(oExcel, 1); // open the first sheet.
    rvSize = excel_sheet_get_size(oSheet);
    nRead = excel_sheet_get_rows(oSheet, 100); // read the first 100 rows
    rmType = excel_sheet_get_row_type(oSheet);
    rmData = excel_sheet_get_row_num(oSheet);
    rmString = excel_sheet_get_row_str(oSheet);
    excel_sheet_close(oSheet);
    excel_close(oExcel);
    return rmString;
}

History

Version Description
5.5.0 New

id-1565306