Sets the PrintArea on the first sheet and workbook of Excel file xlHandle.
Parameters:
Name |
Type |
Value |
Description |
xlHandle |
Integer |
0 - n |
A handle to a 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. |
rowFirst |
Integer |
0 - n |
First row of printable range, counting starts with 0 |
rowLast |
Integer |
0 - n |
Last row of printable range |
colFirst |
Integer |
0 – n |
First column of printable range, counting starts with 0 |
colLast |
Integer |
0 – n |
Last column of printable range |
Available in:
WindowMain |
WindowLink |
YES |
NO |
Used in:
XojoScript Name |
GUID |
Save As Excel sheet : participants list |
E50602AA-F1F7-42E6-A44A-78456DD9B778 |
Save as Excel sheet : seminar participants list |
03C22A3D-FF28-4E22-BB99-D7626BF5F0A4 |
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 '%XLSetPrintArea%'
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)
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")
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
// Define printable range of sheet
XLSetPrintArea(hXL,0,i-1,0,2)
XLSave(hXL)
XL(hXL,"launch")
End If