Skip to main content

Open workbook

Open an .xlsx or .xls workbook (a local path, onedrive:path or a pasted SharePoint or OneDrive link), or a .csv or .txt file (one sheet, saved back as text), or create a new one, as a named session; can open encrypted files, open read-only and skip hidden sheets.

Command in the Excel toolkit · id ooa.excel/open · 16 inputs (1 required), no outputs

Inputs​

InputTypeRequiredDefaultWhat it is
PathFileYesWorkbook path.
SessionStringNoexcelSession name used by later steps.
CreateBooleanNofalseCreate the workbook when it does not exist.
SheetStringNoSheet to make active after opening; the sheet saved as active when empty.
Read onlyBooleanNofalseOpen for reading only: save over the opened file is refused, save_as to another file still works.
PasswordCredentialNoPassword of an encrypted workbook; save keeps the file encrypted with the same password.
First row is the headerBooleanNotrueWhether sheets start with a row of column names; used by get_all_cells, get_range, filter and sort_range when their header input is empty.
Access tokenCredentialNoFor a path starting onedrive: (onedrive:Reports/sales.xlsx): a Microsoft Graph access token from the vault. The workbook is downloaded, and save and close with save upload it back.
DriveStringNome/driveFor onedrive: paths: me/drive (the signed-in user's OneDrive), sites/{site-id}/drive (a SharePoint library) or drives/{drive-id}.
Graph address (URL)StringNohttps://graph.microsoft.com/v1.0Microsoft Graph address (national clouds, tests).
Edit passwordCredentialNoPassword to modify the file (Excel's write access password); a wrong one stops the step. Without it such a file still opens.
Skip hidden sheetsBooleanNofalseLeave hidden sheets out: sheet lists, counts and positions only see visible sheets, and later steps cannot use a hidden sheet.
Sensitivity labelStringNoSensitivity label id (a GUID) to put on the workbook; it may come from the vault.
Label site IDStringNoMicrosoft 365 tenant id (a GUID) the label belongs to.
Continue if label failsBooleanNofalseWhen the label cannot be set, log a warning and go on instead of stopping.
ShareBooleanNofalseAgents this one runs may use it.