Platforms to show: All Mac Windows Linux Cross-Platform
Back to XLBookMBS class.
XLBookMBS.AddConditionalFormat as XLConditionalFormatMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 24.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Only for xlsx files.
Requires LibXL in version 4.x
Some examples using this method:
XLBookMBS.AddCustomNumFormat(customNumFormat as string) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The format string customNumFormat indicates how to format and render the numeric value of a cell. See custom format strings guidelines (in FAQ). Returns the custom format identifier. It's used in XLFormatMBS.NumFormat. Returns 0 if error occurs. Get error info with XLBookMBS.ErrorMessage property.
Some examples using this method:
XLBookMBS.AddFont(initFont as XLFontMBS = nil) as XLFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns nil if error occurs.
The initFont can be from another book.
XLBookMBS.AddFormat(initFormat as XLFormatMBS = nil) as XLFormatMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns nil if error occurs.
The initFormat can be from another book.
Some examples using this method:
XLBookMBS.AddFormatFromStyle(style as Integer) as XLFormatMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 23.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns nil if error occurs.
Please note that after loading a file it will be removed.
See kCellStyle* constants.
XLBookMBS.AddPicture(path as folderitem) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns a picture identifier. Supports BMP, DIB, PNG, JPG and WMF picture formats. Use picture identifier with XLSheetMBS.setPicture(). Returns -1 if error occurs. Get error info with XLBookMBS.ErrorMessage property.
Supports BMP, DIB, PNG, JPG and WMF picture formats.
For XLSX files you can embed SVG graphics with LibXL 4.2 or newer.
See also:
XLBookMBS.AddPicture(path as string) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns a picture identifier. Supports BMP, DIB, PNG, JPG and WMF picture formats. Use picture identifier with XLSheetMBS.setPicture(). Returns -1 if error occurs. Get error info with XLBookMBS.ErrorMessage property.
Supports BMP, DIB, PNG, JPG and WMF picture formats.
For XLSX files you can embed SVG graphics with LibXL 4.2 or newer.
See also:
XLBookMBS.AddPictureData(data as string) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns a picture identifier. Use picture identifier with XLSheetMBS.setPicture(). Returns -1 if error occurs. Get error info with XLBookMBS.ErrorMessage property.
Supports BMP, DIB, PNG, JPG and WMF picture formats.
For XLSX files you can embed SVG graphics with LibXL 4.2 or newer.
XLBookMBS.AddRichString as XLRichStringMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 20.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
XLBookMBS.AddSheet(name as string, initSheet as XLSheetMBS = nil) as XLSheetMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Use initSheet parameter if you wish to copy an existing sheet.
Must be from the same book to copy sheet.
Returns NULL if error occurs. Get error info with XLBookMBS.ErrorMessage property.
Some examples using this method:
XLBookMBS.AddStyledText(StyledText as StyledText) as XLRichStringMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 20.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
We convert attributes like bold, italic, underline, color, font name and size.
XLBookMBS.BookRemoveVBA as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 24.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
It should be called after loading xlsm or xlsb files. Returns true if VBA scripts were found and removed.
Returns true on success and false on failure.
XLBookMBS.BookVersion as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 13.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Version number is encoded as hex number with major version, minor version and bugfix.
XLBookMBS.Constructor(xml as boolean = false)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
xml: If true, creates a book in xlsx format (xml), else one in xls format (binary).
XLBookMBS.CopyContent(dest as XLBookMBS, Options as XLCopyOptionsMBS = nil)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 15.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The plugin loops through all sheets and creates matching sheets on new book.
Formats and fonts are created on the fly.
This allows you to convert from XLS to XLSX or back.
Please report if something is not copied. Of course plugin can only copy what libXL supports, so stuff like movies or diagrams are not copied.
Some examples using this method:
XLBookMBS.CoreProperties as XLCorePropertiesMBS New in 25.0
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 25.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
XLBookMBS.CustomNumFormat(fmt as Integer) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See custom format string guidelines (in FAQ). Returns NULL if error occurs. Get error info with XLBookMBS.ErrorMessage property.
XLBookMBS.DefaultFont(byref fontSize as Integer) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns "" if error occurs. Get error info with XLBookMBS.ErrorMessage property.
XLBookMBS.DelSheet(index as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns false if error occurs. Get error info with XLBookMBS.ErrorMessage property.
XLBookMBS.Font(index as Integer) as XLFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Index must be less than return value of fontCount method.
XLBookMBS.FontCount as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
XLBookMBS.Fonts as XLFontMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
XLBookMBS.Format(index as Integer) as XLFormatMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Index must be less than return value of formatCount method.
XLBookMBS.FormatCount as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
XLBookMBS.Formats as XLFormatMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
XLBookMBS.InsertSheet(index as Integer, name as string = "", initSheet as XLSheetMBS = nil) as XLSheetMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Use initSheet parameter if you wish to copy an existing sheet. Must be from the same book to copy sheet.
Returns NULL if error occurs. Get error info with XLBookMBS.ErrorMessage property.
XLBookMBS.Load(path as folderitem) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns false if error occurs. Get error info with XLBookMBS.ErrorMessage property.
With the constructor of the XLBookMBS object you decide if you want to load XML format or older binary format. If the format of the book object doesn't match the file, it will fail.
Loading a file into the book object clears existing formats, sheets and fonts from previous book. You can recreate the ones you need or search them in the existing formats, fonts or sheets.
See also:
XLBookMBS.Load(path as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns false if error occurs. Get error info with XLBookMBS.ErrorMessage property.
With the constructor of the XLBookMBS object you decide if you want to load XML format or older binary format. If the format of the book object doesn't match the file, it will fail.
Loading a file into the book object clears existing formats, sheets and fonts from previous book. You can recreate the ones you need or search them in the existing formats, fonts or sheets.
See also:
XLBookMBS.LoadMT(path as folderitem) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 17.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as the other method without MT in name, except:
The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.
See also:
XLBookMBS.LoadMT(path as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 17.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as the other method without MT in name, except:
The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.
See also:
XLBookMBS.LoadPartially(path as folderitem, sheetIndex as Integer, firstRow as Integer, lastRow as Integer, keepAllSheets as Boolean = false) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 17.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns false if error occurs or true on success.. Get error info with errorMessage function.
keepAllSheets parameter new in 14.2:
If this is true, all sheets are saved back with XL.Book.Save function,
But only one specified sheet is available for processing, thus LibXL can save more memory. It works only for xlsx files, LibXL ignores this flag for xls files.
See also:
XLBookMBS.LoadPartially(path as string, sheetIndex as Integer, firstRow as Integer, lastRow as Integer, keepAllSheets as Boolean = false) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 17.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns false if error occurs or true on success.. Get error info with errorMessage function.
keepAllSheets parameter new in 14.2:
If this is true, all sheets are saved back with XL.Book.Save function,
But only one specified sheet is available for processing, thus LibXL can save more memory. It works only for xlsx files, LibXL ignores this flag for xls files.
See also:
XLBookMBS.LoadPartiallyUsingTempFile(path as folderitem, sheetIndex as Integer, firstRow as Integer, lastRow as Integer, TempFile as folderitem, keepAllSheets as Boolean = false) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 17.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Specify a temporary file for reducing memory consumption.
Returns false if error occurs or true on success.. Get error info with errorMessage function.
keepAllSheets parameter new in 14.2:
If this is true, all sheets are saved back with XL.Book.Save function,
But only one specified sheet is available for processing, thus LibXL can save more memory. It works only for xlsx files, LibXL ignores this flag for xls files.
See also:
XLBookMBS.LoadPartiallyUsingTempFile(path as string, sheetIndex as Integer, firstRow as Integer, lastRow as Integer, TempFile as String, keepAllSheets as Boolean = false) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 17.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Specify a temporary file for reducing memory consumption.
Returns false if error occurs or true on success.. Get error info with errorMessage function.
keepAllSheets parameter new in 14.2:
If this is true, all sheets are saved back with XL.Book.Save function,
But only one specified sheet is available for processing, thus LibXL can save more memory. It works only for xlsx files, LibXL ignores this flag for xls files.
See also:
XLBookMBS.LoadRaw(data as MemoryBlock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 14.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns false if error occurs. Get error info with errorMessage property.
With the constructor of the XLBookMBS object you decide if you want to load XML format or older binary format. If the format of the book object doesn't match the file, it will fail.
Loading a file into the book object clears existing formats, sheets and fonts from previous book. You can recreate the ones you need or search them in the existing formats, fonts or sheets.
See also:
XLBookMBS.LoadRaw(data as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns false if error occurs. Get error info with errorMessage property.
With the constructor of the XLBookMBS object you decide if you want to load XML format or older binary format. If the format of the book object doesn't match the file, it will fail.
Loading a file into the book object clears existing formats, sheets and fonts from previous book. You can recreate the ones you need or search them in the existing formats, fonts or sheets.
See also:
XLBookMBS.LoadRawMT(data as MemoryBlock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 17.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as the other method without MT in name, except:
The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.
See also:
XLBookMBS.LoadRawMT(data as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 17.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as the other method without MT in name, except:
The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.
See also:
XLBookMBS.LoadRawPartially(data as MemoryBlock, sheetIndex as Integer, firstRow as Integer, lastRow as Integer, keepAllSheets as Boolean = false) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 17.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
data: Data buffer
sheetIndex: loads a file only with specified sheet index, -1 loads all sheets
firstRow: the first row of loaded range, -1 loads all rows until lastRow
lastRow: the last row of loaded range, -1 loads all rows after firstRow.
Returns false if error occurs or true on success. Get error info with errorMessage function.
keepAllSheets parameter new in 14.2:
If this is true, all sheets are saved back with XL.Book.Save function,
But only one specified sheet is available for processing, thus LibXL can save more memory. It works only for xlsx files, LibXL ignores this flag for xls files.
See also:
XLBookMBS.LoadRawPartially(data as string, sheetIndex as Integer, firstRow as Integer, lastRow as Integer, keepAllSheets as Boolean = false) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 17.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
data: Data buffer
sheetIndex: loads a file only with specified sheet index, -1 loads all sheets
firstRow: the first row of loaded range, -1 loads all rows until lastRow
lastRow: the last row of loaded range, -1 loads all rows after firstRow.
Returns false if error occurs or true on success. Get error info with errorMessage function.
keepAllSheets parameter new in 14.2:
If this is true, all sheets are saved back with XL.Book.Save function,
But only one specified sheet is available for processing, thus LibXL can save more memory. It works only for xlsx files, LibXL ignores this flag for xls files.
See also:
XLBookMBS.LoadUsingTempFile(path as folderitem, TempFile as folderitem) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 17.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Specify a temporary file for reducing memory consumption.
Returns false if error occurs or true on success. Get error info with errorMessage function.
See also:
XLBookMBS.LoadUsingTempFile(path as string, TempFile as String) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 17.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Specify a temporary file for reducing memory consumption.
Returns false if error occurs or true on success. Get error info with errorMessage function.
See also:
XLBookMBS.MoveSheet(SourceIndex as integer, DestIndex as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 17.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns false if error occurs and true on success.
XLBookMBS.PackColor(ColorValue as color) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | XL | MBS XL Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
Some examples using this method:
The items on this page are in the following plugins: MBS XL Plugin.
