HotXLS Docs

ApplyFormat method

Applies a previously captured TXLSFormatSnapshot to every cell in an IXLSRange, restoring the full formatting recorded by CaptureFormat

Syntax

procedure ApplyFormat(AFormat: TXLSFormatSnapshot);

Remarks

The snapshot can come from a different workbook or worksheet; the captured format is re-applied to the target range's own format pool. AFormat must not be nil.

Example

var
  Snapshot: TXLSFormatSnapshot;
begin
  Snapshot:= Workbook.Sheets[1].Range['A1', 'D1'].CaptureFormat;
  Workbook.Sheets[2].Range['A1', 'D1'].ApplyFormat(Snapshot);
  Snapshot.Free;
end;

See also