|
|
|
|
- Properties specific to xlsDocument variables
- Accessing a column of an Excel document
- Accessing a cell of an Excel document
- Accessing a cell of a column in an Excel document
- Accessing a cell of a row in an Excel document
- WLanguage functions that use xlsDocument variables
xlsDocument (Variable type)
An xlsDocument variable is used to describe and modify an Excel document. Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
MaFeuille is xlsDocument
NomFichierXLS is string
NomFichierXLS = fSelect(fExeDir(), "", "Sélectionnez un fichier...", ...
"Tous fichiers (*.*)" + TAB + "*.*", "*", fselOpen + fselExist)
IF NomFichierXLS = "" THEN RETURN
MaFeuille = xlsOpen(NomFichierXLS, xlsWrite)
MaFeuille[25,"A"] = "OK"
xlsSave(MaFeuille)
IDFicXLS is xlsDocument
NomFichierXLS is string = fExeDir + "\Suivi d'affaires1.xls"
IDFicXLS = xlsOpen(NomFichierXLS, xlsWrite)
IF ErrorOccurred = False THEN
Azz is int = xlsCurrentWorksheet(IDFicXLS)
Info("Feuille en cours dans le fichier Excel: " + Azz)
IF xlsCurrentWorksheet(IDFicXLS, 2) = True THEN
Info("La feuille courante a été modifiée.")
Info(xlsData(IDFicXLS, 11, 2))
ELSE
Error("Le fichier sélectionné ne comporte pas de seconde feuille!")
END
ELSE
Error("Attention! le fichier est déjà ouvert sur un poste de travail!")
END
Novedad versión 2024
xlsDoc is xlsDocument(xlsVersionXls)
Sintaxis
Declaring an Document XLS without specifying the format Ocultar los detalles
MyVariable is an xlsDocument
In this case, the Variable created does not correspond to a specific Excel format.. The format will be defined when the file is Record'd (according to the extension specified).. Novedad versión 2024
Declare an Document XLS by specifying the format Ocultar los detalles
MyVariable is a xlsDocument (<Format> )
<Format>: Integer constant Document format handled. This parameter can correspond to the following constants:
| | xlsVersionUndefined | Version not defined (value by Default). The format will be defined when the file is Record.. | xlsVersionXls | Document type Xls. | xlsVersionXlsx | Document type Xlsx. |
Observaciones Properties specific to xlsDocument variables The following properties can be used to handle xlsDocument variables: | | | nom | Type used | Effect |
---|
Cell | Array of xlsCell | Cells in the XLS document. | Column | Array of xlsColumn | Column in the XLS document. | File | Character string | Name and full path of XLS file associated with the document. This property is read-only. It is assigned when using xlsOpen. Remark: when assigning an xlsDocument variable into another one, this property is not copied (except during the call to xlsOpen). | Modified | Boolean | - True if the document was modified
- False otherwise.
This property is reset to False after the call to xlsSave. | NumberColumn | entier | Number of columns found in the document (identical to xlsNbColumn). This property is read-only. | NumberRow | entier | Number of rows found in the document (identical to xlsNbRow). This property is read-only. | NumberWorksheet | entier | Number of worksheets found in the document (identical to xlsNbWorksheet). This property is read-only. | RecalculateWhenLoading | Boolean | - True if the formulas of the document must be recalculated when the document is opened in Excel or OpenOffice.
- False if no calculation must be performed when the document is opened in Excel or OpenOffice.
Remark: Only the formulas initially found in the document can be recalculated. | RightToLeft | Boolean | - True if the mode for reading the current worksheet is "Right to left".
- False if the mode for reading the current worksheet is "Left to right".
| Row | Array of xlsRow | Row in the XLS document. | Sheet | entier | Number of the current worksheet (identical to xlsCurrentWorksheet). | SheetName | Character string | Name of the current worksheet. This property can correspond to a string containing between 1 and 31 characters. It is case insensitive. | Version | entier | XLS document version (same as xlsVersion). This property is read-only. |
Accessing a column of an Excel document The following syntaxes can be used to access a column of an Excel document: - MyXLSDocument.Column[1]: Accesses the column 1 of the Excel file.
- MyXLSDocument.Column["A"]: Accesses the column A of the Excel file.
Accessing a cell of an Excel document The following syntaxes can be used to access a cell of an Excel document: - MyXLSDocument[1,2]: Accesses the cell found in row 1 and column 2 of the Excel file.
- MyXLSDocument[5, "A"]: Accesses the cell found in row 5 and column A of the Excel file.
Accessing a cell of a column in an Excel document The following syntaxes can be used to access a cell of a column in an Excel document: - MyXLSDocument.Column[1].Cell: Returns the value of the cell found in column 1 for the current row.
- MyXLSDocument.Column["A"].Cell: Returns the value of the cell found in column "A" for the current row.
Accessing a cell of a row in an Excel document The following syntax can be used to access a cell of a row in an Excel document: - MyXLSDocument.Row[1].Cell[2]: Accesses the cell found in row 1 and column 2 of the Excel file.
- MyXLSDocument.Row[5].Cell["A"]: Accesses the cell found in row 5 and column A of the Excel file.
WLanguage functions that use xlsDocument variables - Standard syntax:
| | xlsAddWorksheet | Añade o inserta una nueva hoja de trabajo en un Excel Document. | xlsCerrar | Cierra un archivo XLS. | xlsColumnTitle | Retrieves the title of a column found in an XLS file. | xlsColumnType | Devuelve el tipo de datos introducidos en una columna de un fichero XLS. | xlsCurrentWorksheet | Se utiliza para averiguar y modificar la hoja de trabajo actual en un archivo XLS. | xlsData | Recupera el contenido de una celda encontrada en un archivo XLS. | xlsDeleteWorksheet | Borra una hoja de trabajo del Excel Document. | xlsGetMerge | Determina si una celda está combinada con otras y obtiene el rango de celdas combinadas. | xlsMergeCell | Combina las celdas especificadas en un documento Excel. | xlsMsgError | Returns the caption of the last error caused by an XLS function. | xlsNbColumn | Returns the number of columns found in a worksheet of an XLS file. | xlsNbColumns | xlsNbColumns se mantiene sólo para la compatibilidad con versiones anteriores. | xlsNbHoja de trabajo | Devuelve el número de hojas de trabajo que se encuentran en un archivo XLS. | xlsNbRow | Devuelve el número de líneas que se encuentran en un archivo XLS. | xlsNbRows | xlsNbRows se mantiene sólo para compatibilidad con versiones anteriores. | xlsOpen | Abre un archivo de Excel (archivos xls o xlsx). | xlsRecalculateAll | Recalcula todas las fórmulas de un documento Excel (XLSX). | xlsSave | Guarda un XLS Document. | xlsUnmergeCell | Anula la combinación de un rango de celdas. | xlsVersion | Devuelve la versión de Excel que se utilizó para grabar el fichero. |
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|