> For the complete documentation index, see [llms.txt](https://boxlang.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boxlang.ortusbooks.com/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetnew.md).

# SpreadsheetNew

Creates a new BoxLang spreadsheet object.

## Method Signature

```
SpreadsheetNew(sheetname=[any], xmlformat=[any])
```

### Arguments

| Argument    | Type      | Required | Description                                                                                      | Default |
| ----------- | --------- | -------- | ------------------------------------------------------------------------------------------------ | ------- |
| `sheetname` | `STRING`  | `false`  | The name of the new sheet. Default is "Sheet1".                                                  |         |
| `xmlformat` | `BOOLEAN` | `false`  | Whether the spreadsheet should use XML format (.xlsx). Default is true, we use the new standard. | true    |

## Examples

Create a new spreadsheet with default settings:

```js
// Create a new spreadsheet (XML format by default)
var spreadsheet = SpreadsheetNew();
println( "Created new spreadsheet" );
```

Create a new spreadsheet with a custom sheet name:

```js
// Create a new spreadsheet with a named sheet
var spreadsheet = SpreadsheetNew( sheetname = "Sales Data" );
println( "Created spreadsheet with sheet: " & spreadsheet.getSheetNames() );
```

Create a spreadsheet in binary format:

```js
// Create a spreadsheet in legacy Excel format (.xls)
var spreadsheet = SpreadsheetNew( sheetname = "Reports", xmlformat = false );
println( "Created binary format spreadsheet" );
```

## Related

* [SpreadsheetRead()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetread.md) - Read existing spreadsheet files
* [SpreadsheetWrite()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetwrite.md) - Save spreadsheets to disk
* [SpreadsheetInfo()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetinfo.md) - Get spreadsheet information
* [IsSpreadsheetObject()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/isspreadsheetobject.md) - Check if object is a spreadsheet
* [Fluent API Guide](https://github.com/ortus-boxlang/boxlang-docs/blob/v1.x/boxlang-framework/boxlang-plus/modules/bx-spreadsheet/api-usage.md) - Using SpreadsheetFile class


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/spreadsheetnew.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.
