# SpreadsheetRead

Reads a sheet from a spreadsheet file and stores it in a BoxLang spreadsheet object.

## Method Signature

```
SpreadsheetRead(src=[any], sheet=[any], format=[any], headerrow=[any], password=[any])
```

### Arguments

| Argument    | Type      | Required | Description                                                                                 | Default |
| ----------- | --------- | -------- | ------------------------------------------------------------------------------------------- | ------- |
| `src`       | `STRING`  | `true`   | The path to the spreadsheet file.                                                           |         |
| `sheet`     | `ANY`     | `false`  | The name or index of the sheet to read. If not specified, reads the first sheet.            |         |
| `format`    | `STRING`  | `false`  | The format of the spreadsheet (not used in this implementation as format is auto-detected). |         |
| `headerrow` | `NUMERIC` | `false`  | The row number to start reading from (1-based). Default is 1.                               |         |
| `password`  | `STRING`  | `false`  | The password for encrypted spreadsheets.                                                    |         |

## Examples

Read a spreadsheet file:

```js
// Read an Excel file from disk
var spreadsheet = SpreadsheetRead( src = "/path/to/file.xlsx" );
println( "Read spreadsheet with " & SpreadsheetGetColumnCount( spreadsheet ) & " columns" );
```

Read a specific sheet from a spreadsheet:

```js
// Read a specific sheet by name
var spreadsheet = SpreadsheetRead(
    src = "/path/to/file.xlsx",
    sheet = "Sales"
);
println( "Read sheet: Sales" );
```

Read a spreadsheet starting from a specific row:

```js
// Skip header rows and start reading from row 5
var spreadsheet = SpreadsheetRead(
    src = "/path/to/file.xlsx",
    sheet = 1,
    headerrow = 5
);
```

Read an encrypted spreadsheet:

```js
// Read password-protected spreadsheet
var spreadsheet = SpreadsheetRead(
    src = "/path/to/encrypted.xlsx",
    password = "myPassword"
);
```

## Related

* [SpreadsheetNew()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetnew.md) - Create a new spreadsheet
* [SpreadsheetReadBinary()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetreadbinary.md) - Read binary format files
* [SpreadsheetWrite()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetwrite.md) - Save spreadsheets
* [SpreadsheetInfo()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetinfo.md) - Get spreadsheet information
* [File Handling Guide](https://github.com/ortus-boxlang/boxlang-docs/blob/v1.x/boxlang-framework/boxlang-plus/modules/bx-spreadsheet/file-handling.md) - Working with spreadsheet files


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetread.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
