XLWriteBoolean(xlHandle As Integer, row As Integer, column As Integer, value As Integer, optional formatHandle As Integer)

 

Writes a bool value into cell with optionally specified format.

 

If you pass in a value of 1, then it will set the cell to "TRUE", otherwise "FALSE".

 

xlHandle to an Excel file is obtained by the XLCreateFromTemplate function. formatHandle is an optional parameter which can be omitted. A formatHandle can be obtained by a call to XLAddFormat.htm.

 

row and column are zero based. Please remember that Excel files have limits like 65536 rows and 256 columns.

 

Parameters:

 

Name

Type

Value

Description

xlHandle

Integer

0 - n

A handle to an Excel document. The document must have been created by using the function XLCreateFromTemplate and the Integer we obtained from it is used as xlHandle here.

row

Integer

0 – n

Index of row to write to

column

Integer

0 – n

Index of column to write to

value

Integer

1 or 0

A parameter value of 1 is used for TRUE

A parameter value of 0 is used for FALSE

formatHandle

Integer

0 - n

Optional handle to a format object. The formatHandle is is obtained by a call to XLAddFormat

 

Available in:

 

WindowMain

WindowLink

YES

NO

 

Used in:

 

XojoScript Name

GUID

Create XL Sheet from template

9A8AAB31-6896-4968-BB1A-DCC61061C9DA

 

Hint: You can find more references to XojoScripts which make use of this function by sending the following SQL statement to the database:

Select id,GUID, ScriptName,ScriptCode from im_scripts where ScriptCode Like '%XLWriteBoolean%'

 

Example XojoScript:

 

Dim hXL As Integer

 

// Get Handle to newly created Excel file

hXL = XLCreateFromTemplate("myXLtest.xls")

 

// Add Format for vertical alignment

Dim frmtHandle As Integer = XLAddFormat(hXL)

 

// Set Alignment of Format

XLFormatSetAlign(hXL, frmtHandle, "ALIGNV", "ALIGNVCENTER")

 

If hXL > -1 Then

Dim i As integer

Dim h As Double = 25

 

For i = 2 To 100

 

// Set row height

XLSetRowHeight(hXL,frmtHandle,i,h)

 

XLWriteString(hXL,i,0,"Zeile " + Str(i),frmtHandle)

XLWriteNumber(hXL,i,1,i,frmtHandle)

XLWriteBlank(hXL,i,2,frmtHandle)

XLWriteBoolean(hXL,i,3,i,frmtHandle)

Next

 

// Set Column Widths, -1 = AutoFit

Dim w As Double = 10

XLSetColWidth(hXL,0,0,w) 

XLSetColWidth(hXL,1,2,-1// AutoFit

 

XLSave(hXL)

XL(hXL,"launch")

 

End If