# List a workbook's sheets

Acquire / file

A variant of [Read a spreadsheet](https://meridian.online/operations/read-a-spreadsheet).

Return the names of the sheets in a workbook rather than their contents.

Page: <https://meridian.online/operations/read-a-spreadsheet/list-a-workbooks-sheets>

## Status

Runs as a SQL step.

arcform carries it as a `sql:` step today, with the `excel` and `zipfs` extensions.

## The DuckDB step

list the sheets of a workbook with no rows read

```sql
INSTALL excel; LOAD excel;
INSTALL zipfs FROM community; LOAD zipfs;
-- a workbook is a zip and lists its sheets in xl/workbook.xml, in the order they appear in the file
CREATE TEMP TABLE result AS
SELECT position, regexp_extract(s, 'name="([^"]*)"', 1) AS sheet_name
FROM (SELECT unnest(arr) AS s, generate_subscripts(arr, 1) AS position
      FROM (SELECT regexp_extract_all(content, '<sheet [^>]*/>') AS arr FROM read_text('zip://<your_scratch_dir>/sheets.xlsx.zip/xl/workbook.xml')));
SELECT * FROM result ORDER BY position;
SELECT CASE WHEN ((SELECT list(sheet_name ORDER BY position) FROM result) = ['Orders', 'Totals', 'Notes'] AND (SELECT count(*) = 1 AND max(region) = 'north' FROM read_xlsx('<your_scratch_dir>/sheets.xlsx', sheet = 'Totals'))) THEN 'as expected' ELSE error('the workbook did not list its sheets Orders, Totals and Notes, or a listed sheet could not be read by name') END AS verdict;
```

Replace `<your_scratch_dir>` with a directory of your own that you can write to before running the statement.

It reads these from `<your_scratch_dir>`, which you supply:

- `sheets.xlsx`: An Excel workbook of three sheets: Orders (order\_id, customer; one row 1, Alice Ng), Totals (region, total; one row north, 420) and Notes (note; one row none).
- `sheets.xlsx.zip`: The same bytes as sheets.xlsx, under a .zip name, for an extension that opens archives by that name.

It needs the `excel` and `zipfs` extensions.

## What other tools call it

Meridian's classification; an independent blind rating agreed on 95.7% of 324 rows (variant, version 3).

- KNIME Analytics Platform: [`Read Excel Sheet Names`](https://api.hub.knime.com/nodes/*pSZxsfdYwqHb7ecJ?details=full) (read 2026-09-27)
- RapidMiner Studio: [`List Google Sheets`](https://docs.rapidminer.com/latest/studio/operators/data_access/cloud_storage/google_sheets/google_sheets_iterator.html) (read 2026-09-27)
- RapidMiner Studio: [`Read Excel Sheet Names`](https://docs.rapidminer.com/latest/studio/operators/extensions/Operator%20Toolbox/data_access/read_excel_sheetnames.html) (read 2026-09-27)
