Excel Online — Close
Excel Online — Close
Section titled “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.
How it works
Section titled “How it works”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.
Required parameters
Section titled “Required parameters”None.
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanExcelOnlineSession | — | Excel Online — Connect session to close. Inherited inside Connect’s body. |
Output
Section titled “Output”This activity does not return a 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. | 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.
Example
Section titled “Example”Excel Online — Connect credential = credential("m365-finance") path = "Reports/Book.xlsx" → output: sessionExcel Online — Write cell session = session sheet = "Sheet1" cell = "A1" value = "Reviewed"Excel Online — Close session = sessionTo 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.
Related activities
Section titled “Related activities”- Excel Online — Connect — open the workbook.
- All Excel Online activities