Platforms to show: All Mac Windows Linux Cross-Platform

Back to XLBookMBS class.

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
NRemoves all VBA scripts (macros) from the workbook.

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
Returns the version number of this book.
Example
Var b as new XLBookMBS
Var v as Integer = b.BookVersion

Var h as Integer = v \ 256 \ 256 \ 256
Var m as Integer = v \ 256 \ 256 mod 256
Var l as Integer = v \ 256 mod 256

MsgBox "libXL "+str(h)+"."+str(m)+"."+str(l)

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
Creates a new XLBookMBS object.

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
Copies all content from one book to other book.

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

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns workbook properties.

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
Returns a custom format string for specified custom format identifier fmt.

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 a default font name and size for this workbook.

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
Deletes a sheet with specified index.

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
Returns a font with defined index.

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
Returns a number of fonts in this book.

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
Returns array with all defined fonts.

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
Returns a format with defined index.

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
Returns a number of formats in this book.

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
Returns array with all defined formats.

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
Inserts a new sheet to this book at position index, returns the sheet.

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.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
Takes a sheet with SourceIndex and insert it in front of a sheet with DestIndex.

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
Packs red, green and blue components in color type.
Example
// define a format for red fill
Var redBackgroundFormat As XLFormatMBS = book.AddFormat
Var c As Color = &cFF0000
// will give back numeric value of color for RGB mode or color index
Var n As Integer = book.PackColor(c)
// we set forecolor of the pattern to fill background!
redBackgroundFormat.PatternForegroundColor = n
redBackgroundFormat.PatternBackgroundColor = n
redBackgroundFormat.FillPattern = XLFormatMBS.FillPatternSolid

Var row As Integer = 5 // 6th row
Var col As Integer = 1 // Column B
Var value As Double = 123

Call sheet.WriteNumber row, col, value, redBackgroundFormat

See also:

Some examples using this method:

XLBookMBS.PackColor(red as Integer, green as Integer, blue as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Packs red, green and blue components in color type.

See also:

XLBookMBS.PackDate(d as date) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Packs date and time information into double type.

See also:

Some examples using this method:

XLBookMBS.PackDate(year as Integer, month as Integer, day as Integer, hour as Integer = 0, min as Integer = 0, sec as Integer = 0, msec as Integer = 0) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Packs date and time information into double type.

See also:

XLBookMBS.PackDateTime(d as dateTime) as double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 20.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Packs date and time information into double type.

XLBookMBS.Picture(index as Integer, byref 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 at position index in memory buffer.

Parameters:
index: position in the workbook
data: reference to buffer

Returns type of picture. See PictureType* constants.

XLBookMBS.PictureCount 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 number of pictures in this workbook.

XLBookMBS.RemoveAllPhonetics

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Removes all phonetics data (furigana) from a workbook.

XLBookMBS.RemovePrinterSettings as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 24.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Removes all printer settings from the workbook.

It should be called after loading an Excel file. Returns true if printer settings were found and removed.
Returns true on success and false on failure.

XLBookMBS.UnpackColor(ColorValue as Integer) as color

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Unpacks color type to red, green and blue components.

See also:

XLBookMBS.UnpackColor(ColorValue as Integer, byref red as Integer, byref green as Integer, byref blue as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Unpacks color type to red, green and blue components.

See also:

XLBookMBS.UnpackDateTime(Value as double) as dateTime

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 20.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Unpacks date and time information from double type.

Returns nil if error occurs.

The items on this page are in the following plugins: MBS XL Plugin.


The biggest plugin in space...