Xbasic

Office::ExcelDocument Class

Description

The Office::ExcelDocument class is the parent class for creation and editing of Excel 2007 (.xlsx) documents.

Properties

CallResult

CallResult property

FileNameCharacter

String FileName property

ActiveSheetIndexNumeric

Numeric ActiveSheetIndex property

ErrorMessageCharacter

String ErrorMessage property

SheetCountNumeric

Numeric SheetCount property

FormatCountNumeric

Numeric FormatCount property

FontCountNumeric

Numeric FontCount property

Methods

AddCustomNumericFormat Method

Add a new numeric format to the document.

AddFont Method

Create a new font and add it to the document. You can pass an existing font to copy its values into the new one.

AddFormat Method

Create a new format and add it to the document. You can pass an existing format to copy its values into the new one.

AddPicture Method

Add a new picture to the document from the file specified. Formats supported include BMP, DIB, PNG, JPG and WMF Use the index value returned to reference the picture in other functions such as Office::Spreadsheet::SetPicture().

AddSheet Method

Add a new spreadsheet to the document assigning it the name provided.

AddSheetFromDBF Method

Create a new spreadsheet and add it to the document. Add the data in the table. Optionally include headings, select a range of rows and include a SQL::TableInfo and user context to handle advanced transformations.

AddSheetFromResultSet Method

Create a new spreadsheet and add it to the document. Add the data in the result set. Optionally include headings, select a range of rows and include a SQL::TableInfo and user context to handle advanced transformations.

Clear Method

Reinitialize the Excel document as a new one. Any unsaved data will be lost when this method is called.

CopySheet Method

Add a new spreadsheet to the document with the name specified by copying the contents of the sheet at index N.

CustomNumericFormat Method

Get the format expression for the custom numeric format at the index specified.

DefaultFont Method

Get the default font name and size for this workbook.

DeleteSheet Method

Delete the sheet at the index specified from the Excel document.

FindSheet Method

Get a spreadsheet by name.

GetFont Method

Get the font indexed by Index. Index must be a value between 1 and the number of fonts returned by the FontCount property.

GetFormat Method

Get the format indexed by Index. Index must be a value between 1 and the number of formats returned by the FormatCount property.

GetSheet Method

Get the spreadsheet at the index specified.

GetSheetNames Method

Gets a list of sheets in an Excel document.

Load Method

Load the contents of an existing Excel 2007 (.xlsx) file.

LoadFromBlob Method

Load the Excel Document from a memory image of an Excel 2007 (.xlsx) file.

NewInstance Method

Creates a new instance of an Office::ExcelDocument object.

Save Method

Save the document to an Excel 2007 (.xlsx) file.

SaveToBlob Method

Save the document to a memory image of an Excel 2007 (.xlsx) file.

SetActiveSheet Method

Set the index of the spreadsheet that is considered active/current.

SetDefaultFont Method

Set a default font name and size for this workbook.

SetLocale Method

Set the locale name for the document.

SheetsToJson Method

Gets all sheets and cell values as JSON.

SheetToJson Method

Get a specific sheet and cell values as JSON.

ToJson Method

Returns all the Sheets in a spreadsheet as json.

The Office::ExcelDocument class is for working with Excel 2007 (.xlsx) files. For Excel 2003 (.xls) files, use Office::Excel2003Document.

See Also