XLFormatSetFillPattern(xlHandle As Integer, formatHandle As Integer, value As String)

 

Sets the fill pattern of a cell.

 

The type of fill pattern must be assigned to format. Then the format can be assigned to one or more cells when using XLWriteÉ functions. Before the fill attribute can be set to a format, the format must have been created by using the XLAddFormat function.

 

 

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.

formatHandle

Integer

0 - n

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

value

String

Diagcrosshatch

Sets the fill pattern of a cell

 

 

Diagstripe

 

 

 

Gray12P5

 

 

 

Gray25

 

 

 

Gray50

 

 

 

Gray6P25

 

 

 

Gray75

 

 

 

Horstripe

 

 

 

None

 

 

 

Revdiagstripe

 

 

 

Solid

 

 

 

Thickdiagcrosshatch

 

 

 

Thindiagcrosshatch

 

 

 

Thindiagstripe

 

 

 

Thinhorcrosshatch

 

 

 

Thinhorstripe

 

 

 

Thinrevdiagstripe

 

 

 

Thinverstripe

 

 

 

Verstripe

 

 

Available in:

 

WindowMain

WindowLink

YES

NO

 

Used in:

 

XojoScript Name

GUID

Save as Excel sheet : seminar invoice list

6DDAFA87-2862-4129-8416-CBD57C5CDF9A

 

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 '%XLFormatSetFillPattern%'

 

Example XojoScript:

 

Dim hXL As Integer

 

// Get Handle to newly created Excel file

hXL = XLCreateFromTemplate("myXLtest.xls")

 

// Set default font for Excel sheet

XLSetDefaultFont(hXL,"Arial Narrow",8)

 

Dim listfont As Integer = XLAddFont(hXL,"Arial Narrow",8)

XLFontSetColor(hXL,listfont,"&h00FF0000"// red

 

Dim listformat As Integer = XLAddFormat(hXL)

Dim numberformat As Integer = XLAddFormat(hXL)

 

// Add font to formats

XLFormatSetFont(hXL,listformat,listfont)

XLFormatSetFont(hXL,numberformat,listfont)

 

// Set properties of listformat

XLFormatSetBorderBottom(hXL,listformat,"Hair")

 

// Set properties of numberformat

XLFormatSetAlign(hXL,numberformat,"AlignH","AlignHRight")

XLFormatSetNumFormat(hXL,numberformat,"NumformatNumberD2SepNegbraRed")

XLFormatSetBorderBottom(hXL,numberformat,"Hair")

 

// Set FillPattern

XLFormatSetFillPattern(hXL,numberformat,"Solid")

XLFormatSetPatternColor(hXL,numberformat,"ForegroundColor","&h00E6E6E6")

 

If hXL > -1 Then

Dim i As integer

For i = 2 To 100

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

XLWriteNumber(hXL,i,1,i,numberformat)

XLWriteBoolean(hXL,i,2,i)

Next

 

XLSave(hXL)

XL(hXL,"launch")

End If