Skip to main content

AddSheet

Creates a new worksheet. The new worksheet becomes the active sheet.

Syntax

expression.AddSheet(sName);

expression - A variable that represents a Api class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sNameRequiredstringThe name of a new worksheet.

Returns

ApiWorksheet

Example

Insert a new sheet with a custom name into a spreadsheet.

// How do I add a new worksheet to an existing file in a spreadsheet?

// Expand the workbook by creating an additional sheet in a spreadsheet.

Api.AddSheet("New sheet");