Excel Online — Write cell
Excel Online — Write cell
Section titled “Excel Online — Write cell”Type: excelonline-write-cell · Package: Excel Online v1.0.4
Writes a value to a single cell. The change is saved automatically to the cloud workbook, and anyone who has it open sees it right away.
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, the cell in A1 notation (B3) and the value to write. The value replaces whatever was in the cell; the cell formatting (color, number format) is kept.
Depending on the value’s type:
- Numbers (
int,decimal,double…) and booleans are written as Excel numbers and true/false. - Any other value (dates included) is written as text. To store a date as an Excel date, write its serial number (
date.ToOADate()) and give the cell a date format in the workbook. - A
nullvalue leaves the cell unchanged.
Writing the same value twice gives the same result, so it is safe to retry.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
sheet | string | — | Sheet name. |
cell | string | — | Cell in A1 notation. E.g. B3. |
value | object | — | Value to write: text, number or boolean. |
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”This activity does not return a value. The change is saved automatically.
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, or it is a range of more than one cell. |
accessDenied (Microsoft Graph, 403) | The connection only has read permissions or the account cannot edit the workbook. |
Example
Section titled “Example”Excel Online — Connect credential = credential("m365-finance") path = "Reports/Status.xlsx" └─ body: Excel Online — Find cell sheet = "Summary" value = "Status" → output: cell Excel Online — Write cell sheet = "Summary" cell = "B" + cell["row"] value = "Completed"Related activities
Section titled “Related activities”- Excel Online — Read cell — read a cell.
- Excel Online — Write range — write several cells.
- Excel Online — Find cell — locate the cell to update.
- All Excel Online activities