Skip to content

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.

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 null value leaves the cell unchanged.

Writing the same value twice gives the same result, so it is safe to retry.

ParameterTypeDefaultDescription
sheetstring—Sheet name.
cellstring—Cell in A1 notation. E.g. B3.
valueobject—Value to write: text, number or boolean.
ParameterTypeDefaultDescription
sessionZoanExcelOnlineSession—Excel Online — Connect session. Inherited inside Connect’s body.

This activity does not return a value. The change is saved automatically.

MessageCause 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.
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"