Dokumentacija HotXLS

FreezePanes metoda

Freezes the left columns and top rows of a classic XLS worksheet, creates split panes, or removes pane settings from the worksheet

Sintaksa

function FreezePanes(ARow: Word; ACol: Word): Integer; overload;
function FreezePanes(Row: Word; Col: Word; RowTop: Word; ColLeft: Word): Integer; overload;
function UnfreezePanes: Integer;
function SplitPanes(Width: Single; Height: Single): Integer;
function UnsplitPanes: Integer;
ARow Word. Number of rows to freeze at the top of the worksheet
ACol Word. Number of columns to freeze on the left side of the worksheet
Row, Col, RowTop, ColLeft Word. Low-level BIFF pane values for callers that need explicit scroll positions
Width, Height Single. Split-pane dimensions using the same units as the existing thawed pane helper

Napomene

The two-parameter overload is the recommended entry point for common frozen pane layouts. Passing zero for both values removes frozen panes. Use SplitPanes to create a movable split instead of locked rows or columns. Use UnfreezePanes or UnsplitPanes when code should explicitly clear any existing pane record

Primjer

This example freezes the first column and the first two rows, then replaces the frozen pane with a split pane

var
  Workbook: IXLSWorkbook;
  Sheet: TXLSWorksheet;
begin
  Workbook := TXLSWorkbook.Create;
  Sheet := Workbook.Worksheets.Add;
  Sheet.FreezePanes(2, 1);
  Sheet.UnfreezePanes;
  Sheet.SplitPanes(4, 5);
  Workbook.SaveAs('freeze-panes.xls');
end;