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
Inserts a worksheet into a Spreadsheet control found in a window.
Remark: To use this function, the Spreadsheet control must allow the management of several worksheets:
  • In the window editor: In the "Details" tab of the control description window, check "Allow multiple worksheets".
  • Through programming, use the MultiWorksheet property.
// Insert a worksheet
SpreadsheetInsertWorksheet(PSHEET_MySpreadsheet, 3, "New worksheet")
// Select the worksheet
PSHEET_MySpreadsheet.CurrentWorksheet = 3
SpreadsheetInsertWorksheet(<Spreadsheet control> , <Worksheet position> [, <Worksheet name>])
<Spreadsheet control>: Control name
Name of the Spreadsheet control to be used.
<Worksheet position>: Integer
Position of the worksheet to create.
<Worksheet name>: Optional character string
Name of the worksheet that will be created at the specified position. If this parameter is not specified, the worksheet is created with a default name ("WorksheetX"). This name:
  • appears in the tab used to select the worksheet (at the bottom of the Spreadsheet control).
  • is used to identify the worksheet in the formulas. For example, a formula that is using a cell of "Worksheet2" can be: "=SUM(Worksheet2!B4:D4)".
The function fails and displays a WLanguage error in the following cases:
  • The Spreadsheet control does not manage several worksheets.
  • The name of the worksheet is invalid or it is already used by another worksheet.
  • This function can only be used on a Spreadsheet control found in a window.
Component: wd290obj.dll
Minimum version required
  • Version 20
This page is also available for…
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help