ExcelWriter Xojo Plugin

ExcelWriterWorksheet Class (console safe)

Object that object represents an Excel worksheet.

This class has only private constructor so instances cannot be created directly. To create instance of this class you call the AddWorksheet function on the ExcelWriterWorkbook class.

Object
   ExcelWriterWorksheet

class ExcelWriterWorksheet

Constructors

ExcelWriterWorksheetA private constructor that cannot be called.

Properties

GridLines (console safe) Sets gridline visibility options.
HideZeroValues (console safe) If set to true then zero values in cells are hidden.
Landscape (console safe) Set to true to make the printed worksheet landscape, else false for portrait (false is the default)
LastError (console safe) Gives hints on if last function executed had error or not and which error if there was error.
PageView (console safe) Sets or gets PageView that decides if the worksheet should be displayed in "Page View/Layout" mode or not.
PrintingCenterHorizontally (console safe) When set to true then the worksheet data is centered horizontally between the margins on the printed page.
PrintingCenterVertically (console safe) When set to true then the worksheet data is centered vertically between the margins on the printed page.
PrintingPageOrder (console safe) Sets page print order.
PrintingPaperType (console safe) Used to set the paper format for the printed output of a worksheet.
PrintingRowColumnHeaders (console safe) If set to true then printing options for the worksheet is set to print row and column headers which is by default set to false.
PrintingScale (console safe) Sets the scale factor of the printed page.
Zoom (console safe) Sets or gets the zoom of the worksheet.

Methods

Activate (console safe) Sets the worksheet to the active one in a workbook that has more than one worksheet.
AddHorizontalPageBreakAdds horizontal page break to the document at given location.
AddVerticalPageBreakAdds vertical page break to the document at given location.
CellBlank (console safe) Use this method for cells that should only contain formatting and no data.
CellDateValue (console safe) Sets date of a cell in given row and column, using given formatting object.
CellFormula (console safe) Applies a formula to a given cell, using a specific formatting object.
CellFormula (console safe) Applies a formula to a given cell.
CellNumericValue (console safe) Sets numeric value of a cell in given row and column, using default formatting.
CellNumericValue (console safe) Sets numeric value of a cell in given row and column, using a specific formatting object.
CellText (console safe) Sets text of a cell in given row and column, using a specific formatting object.
CellText (console safe) Sets text of a cell in given row and column, using default formatting.
CellURL (console safe) Sets url of a cell in given row and column, using a specific formatting object or nil if wanting default formatting.
ColumnWidth (console safe) Sets the width of multiple columns
ColumnWidth (console safe) Sets the width of a column
FreezePanes (console safe) Divides worksheet into horizontal or vertical regions known as panes.
InsertChart (console safe) Inserts a chart of a given type into the worksheet. This variation takes detailed options object for the placement of the inserted chart.
InsertChart (console safe) Inserts a chart of a given type into the worksheet.
InsertPicture (console safe) Inserts a picture from a string representation of PNG or JPEG picture into the worksheet. This variation takes detailed options object for the placement of the inserted picture.
InsertPicture (console safe) Inserts a picture from a string representation of PNG or JPEG picture into the worksheet.
InsertPicture (console safe) Inserts a picture from a file. This variation takes detailed options object for the placement of the inserted picture.
InsertPicture (console safe) Inserts a picture from a file.
MergeCells (console safe) Merges cells and writes value to the merged cell.
shared NameToColumnConverts Excel style column row address like A2 to a column number. This function also works on a Excel column range address like B:D or cell range address like A1:K42
shared NameToLastColumnConverts Excel style column range address like B:D to a column number, returning the last component. This will also work on cell range addresses like A1:K42
shared NameToRowConverts Excel style column row address like A2 to a row number.
PrintingFitToPages (console safe) Fits the printed area to a specific number of pages both vertically and horizontally. If the printed area exceeds the specified number of pages it will be scaled down to fit. This ensures that the printed area will always appear on the specified number of pages even if the page size or margins change.
PrintingSetArea (console safe) Specifies the area of the worksheet that will be printed.
PrintingSetMarginsSet the margins of the worksheet when it is printed
PrintingSetRepeatColumnsLets one or more number of columns to repeat to left of each page when printing.
PrintingSetRepeatRowsLets one or more number of rows to repeat at top of each page when printing.
RowHeight (console safe) Sets the height of a row
SelectTab (console safe) Adds the worksheet to the selection of worksheets.
SetAutoFilter (console safe) Sets up auto-filter for give range of columns and rows
SetColumnOptions (console safe) To a given range of columns it sets column with, column formatting and decides if columns should be hidden.
SetFooter (console safe) Sets footer text and header margin for the worksheet.
SetHeader (console safe) Sets header text and header margin for the worksheet.
SetRowDefaults (console safe) Sets default height for all rows in the worksheet and determines if unused rows should be shown or not.
SetRowOptions (console safe) Sets for row the height, row formatting and decides if the row should be hidden.
SetTabColor (console safe) Sets the color of the worksheet tab.
WriteArrayFormula (console safe) Writes result of a formula that can return multiple results into one or more cells

Enumerations

GridLineOptionValuesA enum that is used for Grid line options by the GridLines property.
PageOrderValuesEnum values for the PrintingPageOrder property.

Constants

DEFAULT_ROW_HEIGHT = 15.0A constant that defines the default row height in a Excel document. You can use the SetRowDefaults method to affect default row height in a specific worksheet.
DEFAULT_COLUMN_WIDTH = 8.43A constant that defines the default column width in a Excel document.
DEFAULT_HEADER_MARGIN = 0.3Default header margin in inches. (This constant is used with the SetHeader method if not wanting to change the margin when changing the header it self)
DEFAULT_FOOTER_MARGIN = 0.3Default footer margin in inches. (This constant is used with the SetFooter method if not wanting to change the margin when changing the footer it self)

Dim f as FolderItem

f = GetSaveFolderItem("*.*","Test.xlsx")

if f <> nil then
    Dim writer as ExcelWriterWorkbook = ExcelWriterWorkbook.Create(f, ZStream.GetZipEngineHandle())
    Dim sheet as ExcelWriterWorksheet = writer.AddWorksheet()
   
    sheet.CellText(2,2) = "Hello world"
   
    call writer.Close()
end if

Supported Platforms:

  • MacOS X Carbon
  • MacOS X Cocoa 32 bit
  • MacOS X Cocoa 64 bit
  • Windows 32 bit
  • Windows 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM