Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.6d

Application v 6.1b

  

 

Chapter EightData Functions (continued)

WorkbookInsertSheet Function

Overview

The WorkbookInsertSheet function inserts a data sheet into a workbook at a specified location.

Syntax/Parameters

Syntax

int = WorkbookInsertSheet ( handle hWorkbook, handle hSheet, int index );

Parameters

hWorkbook

A handle to a Workbook Object.

hSheet

A handle to a Data Sheet Object.

index

An int specifying the zero-based position to insert the sheet. If the value is -1 the sheet is appended to the workbook list of sheets.

Return Value

Returns an int as ERROR_NONE or a formatted error code on failure. Use the GetLastError and GetLastErrorMessage to retrieve additional information.

Remarks

Each handle is added to an internal array for later use on export. The object handles added must remain intact until the workbook is written.

If the sheet is not named upon insert, it will be named “Sheet x” based on the index position of the insertion. This does not guarantee a unique sheet name. Use DataSheetSetSheetName to add a name to the sheet.

This function does not update the internal information table. It is updated when the workbook is exported.

Up to 512 data sheets can be inserted.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Page revised 2025-08-15