PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
xlsCurrentWorksheet (Function)
In French: xlsFeuilleEnCours
Used to find out and modify the current worksheet in an XLS file.
Notes:
  • In multi-sheet mode, the functions used to manage the XLS files always apply to the current worksheet. When the XLS file is opened, the 1st worksheet of the workbook is the current worksheet.
  • This function has no effect in compatible mode.
Versions 16 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
New in version 16
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
Example
// Open an XLS file
FileIdentifier is int
FileIdentifier = xlsOpen("C:\My Documents\Test.XLS")

// Operations on the XLS file
// ...

// Retrieve the current worksheet
Worksheet is int = xlsCurrentWorksheet(FileIdentifier)
Info("The current worksheet is " + Worksheet)
// Open an XLS file
FileIdentifier is int = xlsOpen("C:\My Documents\Test.XLS")

// Position on the last worksheet of the file
NbWorksheet is int = xlsNbWorksheet(FileIdentifier)
IF xlsCurrentWorksheet(FileIdentifier, NbWorksheet) = True THEN
Info("The current worksheet was modified.")
END
cMyXLSFile is xlsDocument
sMyFile is string = "File.xls" // Full name of the file to open

cMyXLSFile = xlsOpen(sMyFile, xlsWrite)
IF ErrorOccurred = False THEN
Azz is int = xlsCurrentWorksheet(cMyXLSFile)
Info("Current worksheet in the Excel file: " + Azz)
// Change the worksheet
IF xlsCurrentWorksheet(cMyXLSFile, 2) = True THEN
Info("The current worksheet was modified.")
// Read a cell for test
Info(xlsData(cMyXLSFile, 11, 2))
ELSE
Error("The selected file does not include a second worksheet!")
END
ELSE
Error(ErrorInfo(errFullDetails))
END
xlsClose(cMyXLSFile)
Syntax

Finding out the current worksheet Hide the details

<Result> = xlsCurrentWorksheet(<XLS Document>)
<Result>: Integer
Subscript of the current worksheet. This value is included between 1 and xlsNbWorksheet.
<XLS Document>: xlsDocument variable
Name of xlsDocument variable to use.

Modifying the current worksheet Hide the details

<Result> = xlsCurrentWorksheet(<XLS Document> , <Worksheet Number>)
<Result>: Boolean
  • True if the current worksheet was modified,
  • False otherwise (if the worksheet specified in <Worksheet Number> does not exist for example).
<XLS Document>: xlsDocument variable
Name of the xlsDocument variable to use.
<Worksheet Number>: Integer
Subscript of the new worksheet. This value is included between 1 and xlsNbWorksheet.

Finding out the current worksheet (syntax kept for backward compatibility with version 12) Hide the details

<Result> = xlsCurrentWorksheet(<Identifier of XLS File>)
<Result>: Integer
Subscript of the current worksheet. This value is included between 1 and xlsNbWorksheet.
<Identifier of XLS File>: Integer
Identifier of XLS file to handle, returned by xlsOpen.

Modifying the current worksheet (syntax kept for backward compatibility with version 12) Hide the details

<Result> = xlsCurrentWorksheet(<Identifier of XLS File> , <Worksheet Number>)
<Result>: Boolean
  • True if the current worksheet was modified,
  • False otherwise (if the worksheet specified in <Worksheet Number> does not exist for example).
<Identifier of XLS File>: Integer
Identifier of XLS file to handle, returned by xlsOpen.
<Worksheet Number>: Integer
Subscript of the new worksheet. This value is included between 1 and xlsNbWorksheet.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230xls.dll
Linux wd230xls.so
Minimum required version
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment