# Workbook.load Method

> Workbook.load method in the TX Sheet Control Angular package: Loads XLSX/TXWB bytes or CSV/XML/JSON text/UTF-8 bytes atomically.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Sheet Control > API Reference > TypeScript API > Angular > Workbook > Workbook.load Method
- **995 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/angular/workbook/load-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/angular/workbook/load-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/angular/workbook/load-method/llms-full.txt

---

Loads XLSX/TXWB bytes or CSV/XML/JSON text/UTF-8 bytes atomically. Tabular formats replace the workbook with one worksheet.

Owner: [Workbook](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/angular/workbook/llms-full.txt). Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

### Syntax

#### Overload 1

```typescript
load(input: string, streamType: StreamType.CSV | StreamType.XML | StreamType.JSON, options?: LoadOptions): Promise<LoadResult>
```

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `input` | `string` | No | Document bytes in the selected format. |
| `streamType` | `StreamType.CSV \| StreamType.XML \| StreamType.JSON` | No | The supported input or output format. PDF is output-only. |
| `options` | `LoadOptions \| undefined` | Yes | Supported settings for this operation; omitted settings retain documented defaults. |

Return value: `Promise<LoadResult>`.

#### Overload 2

```typescript
load(input: Uint8Array | ArrayBuffer, streamType: StreamType, options?: LoadOptions): Promise<LoadResult>
```

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `input` | `ArrayBuffer \| Uint8Array<ArrayBufferLike>` | No | Document bytes in the selected format. |
| `streamType` | `StreamType` | No | The supported input or output format. PDF is output-only. |
| `options` | `LoadOptions \| undefined` | Yes | Supported settings for this operation; omitted settings retain documented defaults. |

Return value: `Promise<LoadResult>`.

### Examples

After initialization, load CSV text with flat settings, reacquire its worksheet, calculate totals, format the table and export XLSX bytes. XML and JSON text use the same load contract with their stream type.

```typescript
import type { TXSheetControlComponent } from '@txtextcontrol/tx-sheet-control/angular';
import { StreamType } from '@txtextcontrol/tx-sheet-control';

async function importCustomerOrders(component: TXSheetControlComponent) {
    await component.load('Customer;Amount\nMüller;125,5', StreamType.CSV, {
        sheetName: 'Orders',
        delimiter: ';',
        decimalSeparator: ',',
    });

    const sheet = component.control!.workbook.sheets.get('Orders');
    sheet.range('A1:C1').setValues([['Customer', 'Amount', 'Total']]);
    sheet.cell('C2').setFormula('=B2*1.19');
    sheet.range('A1:C1').format({ bold: true, fillColor: '#e5eef4' });
    sheet.range('B2:C2').format({ numberFormatCode: '#,##0.00' });
    return await component.save(StreamType.SpreadsheetML);
}
```

### Remarks

Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.

### See Also

- [Workbook Class](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/angular/workbook/llms-full.txt)
- [Loading and Saving Workbooks](https://docs.textcontrol.com/tx-sheet-control/document-processing/load-save/llms-full.txt)
- [LoadOptions Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/angular/loadoptions/llms-full.txt)
- [LoadResult Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/angular/loadresult/llms-full.txt)
- [StreamType Enumeration](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/angular/streamtype/llms-full.txt)

---

## Nearby

- **Previous:** [Workbook.listNamedStyles Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/angular/workbook/listnamedstyles-method/llms-full.txt)
- **Next:** [Workbook.maxColumns Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/angular/workbook/maxcolumns-property/llms-full.txt)
