AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos XLS
  • Number of columns in an XLS file
xlsNbColumn (Example)
Number of columns in an XLS file
The following code returns the number of columns in an XLS file. The columns that are entirely empty are not taken into account (True). This file was opened by xlsOpen.
// Declare the variables
XLSFileID is int
ResNbColumns is int
// Open an XLS file
XLSFileID = xlsOpen("C:\MyDirectories\MyFiles\File.XLS")
IF XLSFileID <> -1 THEN
// Number of columns
ResNbColumns = xlsNbColumn(XLSFileID, True)
IF ResNbColumns <> -1 THEN
 IF ResNbColumns = 0 THEN
 // There is no column
 Info("The XLS file contains no column")
 ELSE
 // Display the number of columns
 Info("The file contains: " + ResNbColumns + ...
"columns")
 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