HotXLS Docs

AddCopy method

Copies an existing worksheet (from the current or another workbook) and appends it to the worksheets collection

Grouped Classic drawings

The finite grouped worksheet-copy profile carries admitted nested hierarchy, current typed text and geometry, embedded images and text-run font values over to the freshly created destination sheet

Unsupported owners, resource dependencies and palette mappings are refused during preflight; drawing-resource rollback does not bring whole-workbook transactional copying along

Embedded Classic charts

Since 2.384.470 an ordinary standalone embedded chart on the source sheet is copied into the newly created destination sheet in the same workbook or across workbooks, with its complete record stream cloned, its local cell references rebound to the copied worksheet and its font references migrated by font value into the destination catalogue

Chart colours are stored as palette indexes rather than absolute colours and migrate verbatim, so a cross-workbook copy refuses in preflight unless the destination indexed-colour palette resolves every index identically

A copied chart frame keeps only the shape properties it stores itself, so an inherited ordinary scalar document default the destination drawing group does not declare is materialised into the copied frame with its exact source value, while an inherited opaque or image-bearing default and a conflicting declared value refuse in preflight

Every refusal happens before the destination worksheet is created, so a refused copy publishes no font, cell or workbook generation

Grouped chart topology, source Metro dependencies, general chart formula graphs and external references, populated BIFF chart-cache synchronisation and native copy-consumer acceptance stay outside this profile; see embedded chart whole-sheet copy

Syntax

function AddCopy(SourceSheet: IXLSWorksheet): IXLSWorksheet;

Example

This example copies Sheet1 from another workbook and adds it to the current workbook
Workbook.Sheets.AddCopy(OtherWorkbook.Sheets[1]);

Version 2.384.405 increment

See the qualified expanded lifecycle and its remaining boundaries for the newer finite contract