API
createWorkbook()
Create a multi-sheet workbook with bottom tabs and an add-sheet button.
Signature
ts
function createWorkbook( container: HTMLElement, options?: CreateWorkbookOptions ): WorkbookHandle
| Name | Type | Description |
|---|---|---|
| sheets | WorkbookSheetOptions[] | Initial sheets, each with its own columns and snapshot. |
| toolbar | boolean | ToolbarOptions | Defaults to true. Controls each sheet's toolbar. |
| formulaBar | boolean | Defaults to true. Controls each sheet's formula bar. |
| newSheetRows | number | The initial blank row count for a new sheet. Defaults to 1000. |
| ...CyExcelCoreOptions | object | Default core options for all initial sheets. Per-sheet options take precedence. |
WorkbookHandle
| Name | Type | Description |
|---|---|---|
| getActiveSheet() | CyExcelCore | Return the active sheet's core instance. |
| setActiveSheet(sheetId) | void | Switch the active sheet. |
| addSheet(options?) | string | Append a sheet and return its ID. |
| replaceSheets(sheets) | readonly string[] | Replace all worksheets and return the new IDs. All snapshots are validated and the first replacement mounts before old sheets are released. Replacement clears undo history. |
| — | — | For row insertion and deletion, use insertRows() / deleteRows() on the active CyExcelCore, not WorkbookHandle. |
| dispose() | void | Dispose all sheets and the tab bar. |