PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
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
// Loads the second worksheet of XLSX file
SpreadsheetLoad(PSHEET_Spreadsheet, "Workbook1.XLSX", 2)
Syntax
<Result> = SpreadsheetLoad(<Spreadsheet Control> , <File to Load> [, <Worksheet Number> [, <Option>]])
<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 SpreadsheetClose.
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 SpreadsheetSave associated with the psheetOverwriteAllowed constant. In this case, the data modified by another application will be overwritten.
Note: This parameter is available from version 200057.
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
    SpreadsheetLoad updates the ..FilePath property of Spreadsheet control by associating the name of loaded file to the Spreadsheet control.
    New in version 23
    SpreadsheetLoad updates the ..FilePath property of Spreadsheet control by associating the name of loaded file to the Spreadsheet control.
    SpreadsheetLoad 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,
- ...
Components
WINDEVReports and Queries wd230obj.dll
Minimum required version
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment