# 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()](https://boxlang.ortusbooks.com/boxlang-framework/boxlang-plus/modules/bx-spreadsheet/reference/built-in-functions/spreadsheetread) - Read existing spreadsheet files
* [SpreadsheetWrite()](https://boxlang.ortusbooks.com/boxlang-framework/boxlang-plus/modules/bx-spreadsheet/reference/built-in-functions/spreadsheetwrite) - Save spreadsheets to disk
* [SpreadsheetInfo()](https://boxlang.ortusbooks.com/boxlang-framework/boxlang-plus/modules/bx-spreadsheet/reference/built-in-functions/spreadsheetinfo) - Get spreadsheet information
* [IsSpreadsheetObject()](https://boxlang.ortusbooks.com/boxlang-framework/boxlang-plus/modules/bx-spreadsheet/reference/built-in-functions/isspreadsheetobject) - 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
