Skip to contents

[Experimental]

Usage

sp_workbook_session_create(x, ..., persist_changes = TRUE)

sp_workbook_session_close(x, session_id, ...)

Arguments

x

A SharePoint or OneDrive Excel workbook. Can be a ms_drive_item object, a SharePoint URL, or a path passed to get_sp_item().

...

Additional parameters passed to get_sp_item() if x is not a ms_drive_item object.

persist_changes

If TRUE (default), changes made in the session are saved to the workbook.

session_id

A workbook session ID from sp_workbook_session_create().

Value

sp_workbook_session_create() returns a session ID. sp_workbook_session_close() returns x invisibly.

Details

Use a session to make several requests to a workbook. Requests without a session are sent in a new temporary session by the API. If persist_changes = FALSE, changes made in the session are discarded when it is closed. A session that isn't closed expires after a few minutes.

Requests in the same session see each other's changes immediately. Requests sent without a session may not (see "Reading after writing" in sp_workbook).

See also