Platforms to show: All Mac Windows Linux Cross-Platform

Back to XLBookMBS class.

Previous items

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.Save(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
Saves current workbook into xls-file.
Example
// create new Excel file, pass true for XLSX format or false for older XLS format
Dim book As New XLBookMBS(True)

// add sheet
Dim sheet As XLSheetMBS = book.addSheet("Test")
Call sheet.WriteString(2, 1, "Hello World", Nil)

// write file and launch
Dim file As FolderItem = SpecialFolder.Desktop.Child("Writing data.xlsx")

If book.Save(file) Then
file.Launch
Else
MsgBox "Failed to create file."+EndOfLine+EndOfLine+book.ErrorMessage
End If

Returns false if error occurs. Get error info with XLBookMBS.ErrorMessage property.

See also:

XLBookMBS.Save(path as folderitem, UseTempFile as Boolean) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 17.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Saves current workbook into the file.

Use 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.Save(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
Saves current workbook into xls-file.

Returns false if error occurs. Get error info with XLBookMBS.ErrorMessage property.

See also:

XLBookMBS.Save(path as string, UseTempFile as Boolean) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 17.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Saves current workbook into the file.

Use 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.SaveMT(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
Saves document to file on disk.

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.SaveMT(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
Saves document to file on disk.

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.SaveRaw(byref 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
Saves a xls-file to internal memory buffer.

Returns false if error occurs. Get error info with errorMessage property.

See also:

Some examples using this method:

XLBookMBS.SaveRaw(byref 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
Saves a xls-file to internal memory buffer.

Returns false if error occurs. Get error info with errorMessage property.

See also:

XLBookMBS.SaveRawMT(byref 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
Saves document to memoryblock.

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.SaveRawMT(byref 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
Saves document to string.

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.SetDefaultFont(fontName as string, fontSize as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets a default font name and size for this workbook.

XLBookMBS.SetKey(name as string, key as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets customer's license key.

Call this once for each XLBookMBS object and before you read or write data.

If you have keys for more than one platform, please use #if condition to make sure you pass right key for current platform.

XLBookMBS.SetKeyGlobal(name as string, key as string)   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 18.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Private method to avoid you call this on an object.

Please call shared method in app.open.
Because if you make a new object and set key, it's too late.

See also:

Some examples using this method:

XLBookMBS.SetLocale(locale as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the locale.
Example
dim book as new XLBookMBS(false)
book.SetLocale "en_US.UTF-8"

Sets the locale for this library. It has no effect for unicode projects.

XLBookMBS.Sheet(index as Integer) as XLSheetMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Gets the sheet with specified index.

Returns nil if error occurs. Get error info with XLBookMBS.ErrorMessage property.

XLBookMBS.SheetCount 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 sheets in this book.

Some examples using this method:

XLBookMBS.Sheets as XLSheetMBS()

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 sheets.
Example
Function SheetByName(book as XLBookMBS, name as string) As XLSheetMBS
dim sheets() as XLSheetMBS = book.Sheets
for each s as XLSheetMBS in sheets
if s.Name = name then
Return s
end if
next
End Function

Some examples using this method:

XLBookMBS.SheetType(index as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XL MBS XL Plugin 13.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries type of the sheet.

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.

Previous items

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


The biggest plugin in space...