ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / XLS file functions
  • Supported formats
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Saves an Excel document. The saved document remains open. To close it, you must use <xlsDocument variable>.Close.
The supported formats are:
  • XLSX (Excel workbook),
  • XLSM (Excel macro-enabled workbook),
  • XLTX (Excel template),
  • XLTM (Excel macro-enabled template),
  • New in version 2025
    CSV (csv file).
New in version 2025
Android This function is now available for Android applications.
Android Widget This function is now available in Android widget mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
Example
MyWorksheet is xlsDocument
FileName is string
FileName = fSelect(fExeDir(), "", "Select a file...", ...
	"All files (*.*)" + TAB + "*.*", "*", fselOpen + fselExist)
IF FileName = "" THEN RETURN
MyWorksheet = xlsOpen(FileName, xlsWrite)

// Write OK in the A25 cell
MyWorksheet[25,"A"] = "OK"
// Save
MyWorksheet.Save()
Syntax
<Result> = <XLS document>.Save([<File path> [, <Password>]])
<Result>: Boolean
  • True if saved successfully,
  • False otherwise.
<XLS document>: xlsDocument variable
Name of the variable of type xlsDocument to be used.
<File path>: Optional character string
Full path and name of the XLS file.

If this parameter is specified, the file is saved at the specified location (the existing file is overwritten if necessary).
  • If the file is saved successfully, the File property of the xlsDocument variable contains <File path>. The XLS file remains opened.
  • IF the XLS document is saved with a path that differs from the initial one (corresponds to "Save as"), the source file is closed, the document is saved in the new file and the new XLS file remains opened.
If this parameter is not specified, the path specified in the File property of the xlsDocument variable will be used.
<Password>: Optional character string
Password to use to protect the XLS file at opening. This password must be specified to open the XLS file.
Remarks

Supported formats

The supported formats are:
  • XLSX (Excel workbook),
  • XLSM (Excel macro-enabled workbook),
  • XLTX (Excel template),
  • XLTM (Excel macro-enabled template),
  • New in version 2025
    CSV (csv file).
To convert an XLS file to XLSX and vice versa, simply change the extension in <File path>.
Caution: This conversion loses merged cells, charts, drawings, etc.
CSV files:
  • Only the current sheet is saved.
  • Only cell values are saved. For example, formulas are not saved, but only their result.
Component: wd300xls.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/30/2024

Send a report | Local help