Skip to content

Excel Online — Get sheet names

Type: excelonline-get-sheet-names  ·  Package: Excel Online v1.0.4  ·  Output: List<string>

Returns the list of sheet names in the workbook. Use it to discover the available sheets before reading or writing, to check that a sheet exists or to loop over all of them.

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.

It returns the names in the workbook’s tab order, hidden sheets included. It is read-only.

None.

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

Returns a List<string> with the name of each sheet, from left to right. Loop over it with a For each, access by index (sheets[0] is the first one) or check whether a sheet exists with sheets.Contains("Data").

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.
itemNotFound / other Microsoft Graph errorsThe file no longer exists or is not an .xlsx workbook. Check the file opened by Connect.
Excel Online — Connect credential = credential("m365-finance") path = "Reports/Book.xlsx"
└─ body:
Excel Online — Get sheet names → output: sheets
For each sheet in sheets
└─ Excel Online — Read sheet sheet = sheet has-headers = true → output: sheetData