Skip to content

Excel Online — Close

Type: excelonline-close  ·  Package: Excel Online v1.0.4

Closes an Excel Online session and releases its resources. Changes were already saved automatically (there is no Save step). It is only needed when you opened the session with Connect without body.

It works on the session created with Excel Online — Connect. Pass it in the session parameter.

If you used Connect with body, the session closes automatically when the block ends and you do not need this activity.

Closing the session does not touch the file in OneDrive or SharePoint: every earlier write was saved when it happened. After closing, the session variable can no longer be used by other activities; to keep working with the workbook, open it again with Connect.

None.

ParameterTypeDefaultDescription
sessionZoanExcelOnlineSession—Excel Online — Connect session to close. Inherited inside Connect’s body.

This activity does not return a value.

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.You did not pass session and the activity is not inside Connect’s body. Pass the variable returned by Connect.

Apart from that case, the activity does not fail: it makes no calls to Microsoft 365.

Excel Online — Connect credential = credential("m365-finance") path = "Reports/Book.xlsx" → output: session
Excel Online — Write cell session = session sheet = "Sheet1" cell = "A1" value = "Reviewed"
Excel Online — Close session = session

To close the session even if an activity in between fails, put Close in the finally of a Try / Catch, or use Connect with body, which does it for you.