Docly Developers
Function Updated 23 Oct 2026

loadExcel(file, [startCol], [startRow], [sheetNo])

Loads data from Excel file into an array of objects.

Parameters

filestring (filepath)required

Absolute file path for Excel file (XLSX) to load data from.

startColnumberoptional

Column number of the first header cell (counting from 1). The data rows are read from the same column, so the table can start anywhere on the sheet.
Default 1

startRownumberoptional

Row number of the header row (counting from 1). The data rows start on the row below it.
Default 1

sheetNonumberoptional

Sheet number (counting from 1)
Default 1

Returns

An array of objects, one per row below the header row, down to the last used row of the sheet. The properties are named by the header cells, read from column to the right until the first empty header cell. All values are strings. If the file is not found, a string starting with "Load failed" is returned instead of an array.

Example

Mixed HTML (or any text file) with inline JavaScript between hash signs.
<h1>Product list</h1>
<table>
    <thead>
    <tr>
        <td>Number</td>
        <td>Name</td>
        <td>Price</td>
    </tr>
    </thead>
    <tbody>
#var xlsx = docly.loadExcel("Test files/Example file.xlsx")#
#for(var row of xlsx) {#
    <tr>
        <td>#row.Number#</td>
        <td>#row.Name#</td>
        <td>#format(row.Price, "N")#</td>
    </tr>
#}#
</tbody>
</table>