Help / WLanguage / WLanguage functions / Controls, pages and windows / Spreadsheet functions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Saves the content of a Spreadsheet control in a file in XLSX format.
// Save the current file
// Load the file
// Modify the file
PSHEET_NoName1["A","1"] = "modified"
// Save under a different name
// The "text1.xlsx" file already exists
IF PSHEET_NoName1.Save("test1.xlsx") = False THEN
// Before version 200051, the existing xlsx file is overwritten.
// From version 200051, the existing xlsx file is not modfified.
// The function returns False and an error
// To overwrite the file, use the psheetOverwriteAllowed constant
Error("File not saved " + ErrorInfo()
Info("File saved")
<Result> = <Spreadsheet control>.Save(<File to save> [, <Option> [, <Password>]])
<Result>: Boolean
  • True if the file of Spreadsheet control was saved,
  • False otherwise. ErrorInfo returns more details about the error.
<Spreadsheet control>: Control name
Name of the Spreadsheet control to be used.
<File to save>: Character string
Name and full path of XLSX file where the content of Spreadsheet control will be saved.
<Option>: Optional Integer constant
File save mode if the file already exists:
0 (or nothing)
(Default behavior)
If the XLSX file already exists and is not open (in the Spreadsheet control or another application), it is not saved.
psheetOverwriteAllowedIf the XLSX file already exists and is not open (in the Spreadsheet control or another application), it is overwritten.
<Password>: Optional character string
Password to use to protect the XLSX file at opening. This password must be specified to open the XLSX file.
  • To open the ".xlxs" file saved with another application, it must be closed by <Spreadsheet>.Close.
  • The saved file can be reloaded in a Spreadsheet control via <Spreadsheet>.Load and xlsOpen.
  • This function can only be used on a Spreadsheet control found in a window.
  • <Spreadsheet>.Save updates the FilePath property of Spreadsheet control by associating the name of loaded file to the Spreadsheet control.
Related Examples:
The Spreadsheet control Unit examples (WINDEV): The Spreadsheet control
[ + ] Using the Spreadsheet control.
This example explains how to:
- load an xlsx file in a spreadsheet control,
- save the spreadsheet in a file,
- fill the control with data coming from the database,
- insert rows, columns,
- access the cells and handle them (modify their value, their style, ...),
- enter formulas,
- ...
Business / UI classification: UI Code
Component: wd290obj.dll
Minimum version required
  • Version 23
This page is also available for…
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help