ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / XLS file functions
  • Properties specific to xlsCell variables
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
xlsCell (Variable type)
In french: xlsCellule
An xlsCell variable is used to describe and modify a cell in an Excel document.
This type of variable is used:
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
New in version 2025
Android This type of variable is now available for Android applications.
Android Widget This type of variable is now available in Android widget mode.
iPhone/iPad This type of variable is now available for iPhone/iPad applications.
Example
// Open an Excel file
sExcelFile is string
sExcelFile = fSelect("", "", "Select an Excel file...", "Excel" + ...
	TAB + "*.xlsx" + CR + "All files (*.*)" + TAB + "*.*", "*.xlsx")
IF sExcelFile = "" THEN RETURN

// Open the Excel document
MyDocument is xlsDocument
MyDocument = xlsOpen(sExcelFile)

// Create an xlsCell variable with red background.
Cell is xlsCell
Cell = "WINDEV is incredible!"
Cell.BackgroundColor = LightRed

// Fill in cell A6 
MyDocument..Cell[6,"A"] = Cell

// Saves the modifications
xlsSave(MyDocument)
xlsClose(MyDocument)
Properties

Properties specific to xlsCell variables

The following properties can be used to handle xlsCell variables:
Name Type usedEffect
AlignmentHInteger constantHorizontal cell alignment. The possible values are as follows:
  • haCenter: Aligns to the center.
  • haRight: Aligns to the right.
  • haLeft: Aligns to the left.
AlignmentVInteger constantVertical cell alignment. The possible values are as follows:
  • vaTop: Aligns to the top.
  • vaMiddle: Aligns to the middle.
  • vaBottom: Aligns to the bottom.
BorderBorder variableCharacteristics of cell border.
AndroidAndroid Widget This property is not available.
BackgroundColorInteger or Integer constantCell background color. This color can correspond to:
Before version 24, this property was named "BackgroundColor".
FormulaCharacter stringCell formulas.
Caution: Changing the formula in a cell does not automatically recalculate the formulas in the workbook.
You need to call xlsRecalculateAll after changing the formula of one or more cells to update the values of the cells that contain a formula.

This property can only be used on XLSX documents (it is not available for XLS documents).
MaskCharacter stringDisplay mask in Excel. This mask must correspond to the mask recognized by Excel. For more details, see the documentation about Excel.
MaskWDCharacter stringDisplay mask in WINDEV or WEBDEV format that will be used in the Excel cell ("DD/MM/YYYY" for example). The specified mask is automatically converted into Excel format. The hundredths of a second found in the masks are not supported.
For more details, see Supported masks.
This property is available in write mode.
MultilineBoolean
  • True if the cell is multiline,
  • False otherwise.
FontFont variableFont of cell.
AndroidAndroid Widget This property is not available.
TypeInteger constantExcel type of cell. The possible values are as follows:
  • xlsTypeString: String column or column containing different types of data.
  • xlsTypeDate: "Date" column.
  • xlsTypeDateTime: "DateTime" column.
  • xlsTypeDouble: "Numeric" column.
  • xlsTypeDuration: "Duration" column.
  • xlsTypeError: If an error occurs. To get more details on the error, use xlsMsgError or ErrorInfo with the errMessage constant.
  • xlsTypeTime: "Time" column.
  • xlsTypeCurrency: "Currency" column.
This property is read-only.
ValueType of cell valueValue of the cell.
When defining the style of a column (xlsColumn.DefaultCell), this property is ignored in write mode and it is initialized empty in read mode).
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/09/2024

Send a report | Local help