AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos XLS
  • Number of rows in an XLS file
xlsNbRow (Example)
Number of rows in an XLS file
The following code is used to find out the number of rows in an XLS file. The rows that are entirely empty are not taken into account (True). This file was opened by xlsOpen.
// Declare the variables
XLSFileID is int
ResNbRows is int
// Open an XLS file
XLSFileID = xlsOpen("C:\MyDirectories\MyFiles\File.XLS")
IF XLSFileID <> -1 THEN
// Number of rows
ResNbRows = xlsNbRow(XLSFileID, True)
IF ResNbRows <> -1 THEN
IF ResNbRows = 0 THEN
 // No row was found
 Info("The XLS file contains no row")
ELSE
 // Display the number of rows
 Info("The file contains: " + ResNbRows + "rows")
END
ELSE
// Display the error message
Error(xlsMsgError(XLSFileID))
END
ELSE
// Display an error message if the opening was not performed
 Error(xlsMsgError(XLSFileID))
END
// Close the XLS file
xlsClose(XLSFileID)
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/05/2022

Señalar un error o enviar una sugerencia | Ayuda local