In french: TableurCharge
Loads a file in XLSX format in a Spreadsheet control found in a window.
// Load the second worksheet of the XLSX file
SpreadsheetLoad(PSHEET_Spreadsheet, "Workbook1.XLSX", 2)
<Result> = SpreadsheetLoad(<Spreadsheet control> , <File to load> [, <Worksheet number> [, <Option> [, <Password>]]])
- True if the file was loaded in the Spreadsheet control,
- False otherwise.
<Spreadsheet control>: Control name
Name of Spreadsheet control used.
<File to load>: Character string
Name and full path of file to load. The supported formats are: XLSX, XLSM, XLTX, XLTM.
Caution: You cannot load an XLSX file containing more than 2 millions cells.
<Worksheet number>: Optional integer
- Number of the worksheet to load.
- -1 to use the default behavior:
- If the Spreadsheet control is in multi-worksheet mode, all the worksheets will be loaded.
- If the Spreadsheet control is not in multi-worksheet mode, only the first worksheet will be loaded.
<Option>: Integer constant
Mode for opening the XLSX file to load:
|The XLSX file loaded in the Spreadsheet control is opened in write mode. |
In this mode, to open the ".xlxs" file with another application, it must be closed by SpreadsheetClose
|psheetLoadKeepPassword||The password of the XLSX file loaded in the Spreadsheet control is kept in memory. |
When saving the file ("Save as" or SpreadsheetSave
), it will not be necessesary to specify the file password again.. The password will be kept.
|psheetLoadUnlinked||The XLSX file loaded in the Spreadsheet control is loaded in memory only. The ".xlxs" file can be opened by another application. |
To save the modified data, you must use SpreadsheetSave
associated with the psheetOverwriteAllowed
constant. In this case, the data modified by another application will be overwritten.
<Password>: Optional character string
Password to open the XLSX file to use (if the file is protected by a password).
- The file content is loaded in the Spreadsheet control.
- The former content is deleted.
- The formulas are calculated.
- Some Excel features are not supported.
- The size of the XLSX files that can be loaded is limited to 2 millions cells.
- This function can only be used on a Spreadsheet control found in a window.
- SpreadsheetLoad updates the FilePath property of Spreadsheet control by associating the name of loaded file to the Spreadsheet control.
Unit examples (WINDEV): The Spreadsheet control
Business / UI classification: UI Code
This page is also available for…