Sets the row height.
xlHandle to an Excel file is obtained by the XLCreateFromTemplate function. The row height is applied to rows of the first sheet of the Excel file. formatHandle is an optional parameter which can be omitted. A formatHandle can be obtained by a call to XLAddFormat.htm.
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 |
Optional handle to a format object. The formatHandle is is obtained by a call to XLAddFormat |
row |
Integer |
0 – n |
Index of row to set height |
height |
Double |
0 – n |
Width of a column, as a double value. Example: 10.85 A value of -1 sets the column to AutoFit |
Available in:
WindowMain |
WindowLink |
YES |
NO |
Used in:
XojoScript Name |
GUID |
Save as Excel sheet : seminar invoice list |
6DDAFA87-2862-4129-8416-CBD57C5CDF9A |
Save as Excel sheet : seminar participants list |
03C22A3D-FF28-4E22-BB99-D7626BF5F0A4 |
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 '%XLSetRowHeight%'
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)
XLWriteBoolean(hXL,i,2,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