HotXLS Docs

AddCopy method

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

Grouped Classic drawings

The finite grouped worksheet-copy profile copies admitted nested hierarchy, current typed text and geometry, embedded images and text-run font values into the newly created destination sheet

Unsupported owners, resource dependencies and palette mappings refuse in preflight; drawing-resource rollback does not add whole-workbook transactional copying

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 catalog

Chart colors are stored as palette indexes rather than absolute colors and migrate verbatim, so a cross-workbook copy refuses in preflight unless the destination indexed-color 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 materialized 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 precedes creation of the destination worksheet, so no font, cell or workbook generation is published by a refused copy

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

Syntax

function AddCopy(SourceSheet: TXLSWorksheet): TXLSWorksheet;

Example

This example copies Sheet1 from another workbook and inserts it into 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