Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
XL.Book.AddSheet
Adds a new sheet to this book, returns the sheet index.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| XL | 3.5 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| bookRef | The reference to the workbook. Please use XL.LoadBook to load a file. | $ref | |
| Name | The name for the new sheet. | "Taxsheet" | |
| InitSheet | The index of an existing sheet to use as template. | 0 | Optional |
Result
Returns new sheet index or error message.
Description
Adds a new sheet to this book, returns the sheet index.Use initSheet parameter if you wish to copy an existing sheet.
Note initSheet must be only from this book.
Examples
Writes sheet with red font:
#create new xls file
Set Variable [$book; Value:MBS( "XL.NewBook"; 0 )]
#create fonts
Set Variable [$redColor; Value:MBS( "XL.Color.Pack"; $book; 255; 0; 0)]
Set Variable [$redFont; Value:MBS( "XL.Book.AddFont"; $book)]
Set Variable [$r; Value:MBS( "XL.Font.SetColor"; $book; $redFont; $redColor)]
#
#create formats
Set Variable [$redFormat; Value:MBS( "XL.Book.AddFormat"; $book)]
Set Variable [$r; Value:MBS( "XL.Format.SetFont"; $book; $redFormat; $redFont)]
#
#create sheet
Set Variable [$sheet; Value:MBS( "XL.Book.AddSheet"; $book; "Sales Receipt")]
#
#add number in red
Set Variable [$r; Value:MBS( "XL.Sheet.CellWriteNumber"; $book; $sheet; 5; 3; 123; $redFormat)]
#
Set Field [Writing data::Output; MBS("XL.Book.Save"; $book; "test.xls")]
Set Variable [$r; Value:MBS("XL.Book.Release"; $book)]
See also
- XL.Book.AddCustomNumFormat
- XL.Book.AddFont
- XL.Book.MoveSheet
- XL.Book.Release
- XL.Book.Save
- XL.Book.Sheets
- XL.Date.Pack
- XL.LoadBook
- XL.Sheet.CellWriteNumber
- XL.Sheet.SetCol
Example Databases
Blog Entries
- Use formatted text in Excel files with FileMaker and LibXL
- How to use XL functions with MBS FileMaker Plugin
Created 18th August 2014, last changed 9th July 2015
XL.Book.AddPictureFile - XL.Book.BiffVersion
Feedback: Report problem or ask question.
Links
MBS Xojo Chart Plugins