|
|
|
|
|
<Spreadsheet>.Load (Function) In french: <Tableur>.Charge Loads a file in XLSX format in a Spreadsheet control found in a window. // Load the second worksheet of the XLSX file PSHEET_Spreadsheet.Load("Workbook1.XLSX", 2) Syntax
<Result> = <Spreadsheet control>.Load(<File to load> [, <Worksheet number> [, <Option> [, <Password>]]])
<Result>: Boolean - 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: | | psheetLoadDefault (Default value) | 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 <Spreadsheet>.Close. | psheetLoadKeepPassword | The password of the XLSX file loaded in the Spreadsheet control is kept in memory. When saving the file ("Save as" or <Spreadsheet>.Save), 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 <Spreadsheet>.Save 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). Remarks - 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.
- <Spreadsheet>.Load updates the FilePath property of Spreadsheet control by associating the name of loaded file to the Spreadsheet control.
Related Examples:
|
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
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|