Read Excel Range
Read Excel Range
Section titled “Read Excel Range”Type: excel-read-range · Package: Excel Activities v1.0.0 · Output: DataTable
Reads a range of cells and returns it as a DataTable (tabular data is always a DataTable). Useful when you want to read a specific portion of the sheet: unlike Read Excel Sheet —which reads the whole used range— here you give the exact range.
By default the first row is treated as headers. If your range has none, set hasHeader = no and columns are auto-named (Column1, Column2…).
How it works
Section titled “How it works”Reads the cells from the given range and builds a DataTable. If hasHeader is true (the default), the first row provides the column names; if false, columns are auto-named. Accepts session or path — see the two modes.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
range | expression | Range address, e.g. "A1:D20". |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
session | expression | Excel Open session (instead of path). |
path | expression | Path to the .xlsx (required if there is no session). |
sheet | expression | Name or 1-based index of the sheet. By default, the first. |
hasHeader | yes/no | Treat the first row as headers (default: yes). |
Output
Section titled “Output”Returns a DataTable. Iterate it with For Each and access by column name (row["Total"]), or process it with the DataTable package activities.
Example
Section titled “Example”Read Excel Range path = = asset("data.xlsx") range = "A1:C50" → output: tableLog message = = "Rows read: " + str(rowCount(table))
For Each item = row in = = table └─ body: Log message = = row["Customer"] + " — " + str(row["Total"])Related activities
Section titled “Related activities”- Read Excel Sheet — read the whole sheet as a DataTable.
- Read Excel Cell — read a single cell.
- Write Excel Range — write a DataTable to a range.