Excel Online — Get sheet names
Excel Online — Get sheet names
Section titled “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.
How it works
Section titled “How it works”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.
Required parameters
Section titled “Required parameters”None.
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanExcelOnlineSession | — | Excel Online — Connect session. Inherited inside Connect’s body. |
Output
Section titled “Output”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").
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. | 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 errors | The file no longer exists or is not an .xlsx workbook. Check the file opened by Connect. |
Example
Section titled “Example”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: sheetDataRelated activities
Section titled “Related activities”- Excel Online — Read sheet — read a sheet.
- Excel Online — Used range — dimensions of a sheet.
- Excel Online — Connect — open the workbook.
- All Excel Online activities