HotXLS Docs

Textbox cell geometry

Fixed extents and cell endpoints

Version 2.384.364 adds owned geometry to modern TXLSXTextBox objects through atomic SetCellFrame and SetCellAnchor calls

Rows and columns are 1-based and every offset or extent is an Int64 EMU value; 1 point equals 12700 EMU and 1 centimeter equals 360000 EMU

var Box: TXLSXTextBox;
begin
  Box := Book.Sheets[1].AddTextBox('Fixed frame', 2, 2, 5, 4);
  Box.SetCellFrame(2, 2, 36000, 72000, 1800000, 1080000);
  Book.SaveAsODS('fixed-frame.ods');
  Box.SetCellAnchor(2, 2, 5, 4, 12700, 25400, 54000, 72000);
  Book.SaveAs('cell-endpoints.xlsx');
end;

SetCellFrame takes the start row and column, start X and Y offsets, then positive width and height; SetCellAnchor takes both row/column pairs followed by start X/Y and end X/Y offsets

The readonly AnchorType and HasEndCell distinguish the modes, while FromOffsetXEMU, FromOffsetYEMU, ToOffsetXEMU, ToOffsetYEMU, WidthEMU and HeightEMU expose the active tuple

A one-cell frame has a positive fixed extent and returns 0 for ToRow, ToCol and inactive endpoint offsets; a two-cell anchor has real endpoint indices and returns 0 for inactive fixed extents

Use SetAbsoluteFrame(X, Y, Width, Height) for a standalone rectangular textbox that stays fixed when the worksheet grid changes. All four values are in EMU. The coordinates are nonnegative and the extents are positive, up to the signed 32-bit integer limit. AnchorType returns xaAbsolute, and FromOffsetXEMU and FromOffsetYEMU measure from the worksheet origin

HotXLS also recognizes supported rectangular textboxes stored as twoCellAnchor editAs="absolute" when the markers lie within the first 4096 rows and columns and their worksheet geometry agrees with the shape transform. The editable model and subsequent XLSX saves use a physical absolute anchor. Drawings with conflicting markers or unsupported formatting stay on the retained drawing path

The complete prospective tuple is checked before publication, real changes obey workbook read leases and generation tracking, and an identical active tuple is a no-op

The model supports legal signed EMU values within checked integer and ordered-cell bounds, including 1 EMU; the existing Classic textbox offset units remain unchanged

ODS editing and exact lengths

The finite typed ODS profile imports a draw:frame owned directly by one cell, with fractional start offsets and either a fixed extent or an actual end-cell address and endpoint offsets

ODS source-stream release, public geometry edits, ordinary save and normal typed ODS reopen retain the represented tuple

The admitted exact ODS length subset uses nonnegative EMU values divisible by 9 or 127, with zero allowed; checked rational parsing handles centimeter, millimeter, inch, point and pica lengths without an epsilon

A legal model value outside that subset remains available to semantic and OOXML output, while no-loss ODS save refuses it before changing sink bytes, extent or cursor

Use GetConversionReport(xlsConversionOpenDocument) or loss-disallowing SaveAsChecked to inspect unsupported source geometry, appearance and metadata

Supported standalone absolute frames use an ODS page anchor and retain the text, frame and supported center rotation through checked ODS output and typed reopen. Negative coordinates, shear, grouped page anchors, unsupported coordinate metadata and mixed rich text retain their documented loss boundaries

Output and geometry consumers

OOXML output writes a physical one-cell, two-cell or absolute anchor with its exact geometry. Existing semantic version 3 tags retain the current mode and active tuple

Version 2.384.378 admits strictly qualified flat one-cell and two-cell OOXML textboxes on normal XLSX open while keeping non-qualifying drawings on the raw graph path; see strict OOXML textbox import

Portable capture, drawing bounds, lookup and range deletion use the actual mode and model cell metrics, with a finite coordinate traversal budget

Supported structural insertion retains offsets and moves a one-cell owner without changing its fixed extent; deleting a nonzero two-cell endpoint is refused before worksheet content changes

See typed textbox geometry copying and strict OOXML textbox import for the finite flat-textbox copy and reverse-import profiles; broader drawing mixtures remain unfinished

Native interoperability boundaries

Genuine LibreOffice one-cell and two-cell ODS samples retain their admitted geometry through library edits and normal native save/reopen, and a separate two-cell XLSX sample with endpoint offsets inside its actual target cells passes the original 1/100-millimeter envelope

A retained large-offset XLSX counterexample remains unqualified: the consumer imports an unspecified target column with a narrower default grid and clamps an endpoint offset larger than that cell, changing the physical width

The library does not normalize that legal source tuple or widen the native envelope to hide the mismatch; arbitrary producer defaults and legal marker offsets still need further interoperability work

Unrepresented native style metadata continues to report appearance loss, and native applications can round frame geometry when saving edited ODS files

See uniform textbox fonts for independent family, exact point-size, weight and posture overrides