PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
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
Loads a file in XLSX format in a Spreadsheet control found in a window.
Example
// 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 (with quotes)
Name and full path of file (in XLSX format) to load.
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.
Note: Before version 200057, if this parameter is not specified, the first worksheet of the file is loaded (no management is available for the different worksheets).
<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.
psheetLoadUnlinkedThe 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.
Versions 24 and later
psheetLoadKeepPassword
New in version 24
psheetLoadKeepPassword
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.
Note: This parameter is available from version 200057.
<Password>: Optional character string (with quotes)
Versions 24 and later
Password to open the XLSX file to use (if the file is protected by a password).
New in version 24
Password to open the XLSX file to use (if the file is protected by a password).
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.
  • Versions 23 and later
    <Spreadsheet>.Load updates the ..FilePath property of Spreadsheet control by associating the name of loaded file to the Spreadsheet control.
    New in version 23
    <Spreadsheet>.Load updates the ..FilePath property of Spreadsheet control by associating the name of loaded file to the Spreadsheet control.
    <Spreadsheet>.Load 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,
- ...
Component : wd250obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment