Excel Online — Read cell
Excel Online — Read cell
Section titled “Excel Online — Read cell”Type: excelonline-read-cell · Package: Excel Online v1.0.4 · Output: object
Reads the value of a single cell in a sheet of the workbook.
How it works
Section titled “How it works”It works on the session created with Excel Online — Connect. Pass it in the session parameter, or place this activity inside the body of Excel Online — Connect to inherit it automatically.
Give the sheet by name and the cell in A1 notation (B3). If you give a range (B3:C4), only the value of its first cell is returned. If the cell holds a formula, you get the calculated result, not the formula.
It is read-only: it does not modify the workbook.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
sheet | string | — | Sheet name. |
cell | string | — | Cell in A1 notation. E.g. B3. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanExcelOnlineSession | — | Excel Online — Connect session. Inherited inside Connect’s body. |
Output
Section titled “Output”Returns an object with the cell value in its original type:
| Cell content | Returned value |
|---|---|
| Text | string |
| Number | number (integer or decimal) |
| True / false | bool |
| Date | Excel serial number (e.g. 45458); convert with DateTime.FromOADate(Convert.ToDouble(value)) |
| Empty | empty text ("") |
Assign it to a variable; convert it if you need a specific type (Convert.ToDecimal(total)). To check whether the cell is empty, use string.IsNullOrEmpty(Convert.ToString(value)).
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
No Excel Online session available. Provide 'session' from an excelonline-connect activity, or place this activity inside the Connect activity's body so the session is inherited automatically. | The activity is outside Connect’s body and did not receive session. Place it inside the body or pass session = workbook. |
'sheet' is required. / 'cell' is required. | The parameter is empty or its expression returned null. |
itemNotFound (Microsoft Graph, 404) | There is no sheet with that name. |
InvalidArgument (Microsoft Graph, 400) | cell is not a valid A1 address. |
Example
Section titled “Example”Excel Online — Connect credential = credential("m365-finance") path = "Reports/Budget.xlsx" └─ body: Excel Online — Read cell sheet = "Summary" cell = "B3" → output: total If condition = Convert.ToDecimal(total) > 10000 └─ Log message = "The total is over budget: " + totalRelated activities
Section titled “Related activities”- Excel Online — Write cell — write a cell.
- Excel Online — Read range — read several cells.
- Excel Online — Find cell — locate a cell by its value.
- All Excel Online activities