XL.NewBook
----------

Creates a new workbook in memory.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [XL](component_XL.md) | [2.9](newinversion29.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "XL.NewBook"; XML ) 

**MBS**( **"XL.NewBook";** /\* Creates a new workbook in memory. \*/  
**$XML**) /\* Pass 1 to create a new XML bases Excel file (xlsx).   
Else pass 0 for an old style file (xls).   
Default is 0.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| XML | Pass 1 to create a new XML bases Excel file (xlsx).    Else pass 0 for an old style file (xls).    Default is 0. | 0 |

### Result

Returns book reference number.

### Description

Creates a new workbook in memory.  
Please call [XL.Book.Release](XLBookRelease.md) later to free memory.  
Book reference numbers are starting at 19000 and counting up for each new book.  
### Examples

Create a new book in xls format (older):

 $book = MBS ( "XL.NewBook"; 0 )  
Create a new book in xlsx format (newer):

 $book = MBS ( "XL.NewBook"; 1 )  
### See also

- [XL.Book.AddCustomNumFormat](XLBookAddCustomNumFormat.md)
- [XL.Book.AddFormat](XLBookAddFormat.md)
- [XL.Book.AddSheet](XLBookAddSheet.md)
- [XL.Book.Release](XLBookRelease.md)
- [XL.Book.Version](XLBookVersion.md)
- [XL.CopyContent](XLCopyContent.md)
- [XL.Font.SetColor](XLFontSetColor.md)
- [XL.Format.SetWrap](XLFormatSetWrap.md)
- [XL.Sheet.CellWriteNumber](XLSheetCellWriteNumber.md)
- [XL.Sheet.SetCol](XLSheetSetCol.md)

### Release notes

- **Version 8.0**
    - Added better error message when calling [XL.LoadBook](http://www.mbsplugins.eu/XLLoadBook.shtml) or [XL.NewBook](http://www.mbsplugins.eu/XLNewBook.shtml) without calling [XL.Initialize](http://www.mbsplugins.eu/XLInitialize.shtml).

### Example Databases

- [XL/AutoFilter](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/AutoFilter.shtml#1ScriptAnchor_)
- [XL/Conditional Formatting](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/Conditional%20Formatting.shtml#1ScriptAnchor_)
- [XL/Converter](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/Converter.shtml#1ScriptAnchor_)
- [XL/Export records](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/Export%20records.shtml#2ScriptAnchor_)
- [XL/Writing data](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/Writing%20data.shtml#1ScriptAnchor_)
- [XL/XL Import and Export](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/XL%20Import%20and%20Export.shtml#2ScriptAnchor_)

### Blog Entries

- [MBS Plugin Advent calendar: 13 - XL](https://www.mbsplugins.de/archive/2023-12-13/MBS_Plugin_Advent_calendar_13_/monkeybreadsoftware_blog_filemaker)
- [How to use XL functions with MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2015-02-09/How_to_use_XL_functions_with_M/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 5/2022, Seite 22](https://filemaker-magazin.de/neuigkeit/4196-Appetithappen-FMM_202205)

This function checks for a license.

Created 18th August 2014 , last changed 12nd September 2024

  
[XL.LoadBookPartially](XLLoadBookPartially.md) - [XL.Sheet.AddConditionalFormatting](XLSheetAddConditionalFormatting.md)

[HTML Version](XLNewBook.shtml)