Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt

Freezes panes in a worksheet or returns the cell at which the panes are split. Set the property to a Cell object. The worksheet will be split cell specified in Worksheet.FreezePanes is the first unfrozen cell; freeze panes will be applied to all rows above the cell , and all columns to the left of it, or boththe cell.

Signature
C#
C#
 public Cell FreezePanes{ get; set; }

...

Remarks

Freeze panes can only be applied to the first few rows or first few columns of a worksheet. The cell specified in Worksheet.FreezePanes is the first unfrozen cell; freeze panes will be applied to all rows above the cell and all columns to the left of the cell. This is a limitation of Excel and not ExcelWriter.

Image Added

Example
Code Block
csharp
csharp
titleC#

          //--- Get FreezePanes
          Cell freezeCell = ws.FreezePanes;

          //--- Set FreezePanes for rows 1-5 and columns A, B
          ws.FreezePanes = ws.Cells["C5"];
        
Code Block
vb.net
vb.net
titlevb.net

          '--- Get FreezePanes
          Dim freezeCell As Cell = ws.FreezePanes

          '--- Set FreezePanes for rows 1-5 and columns A, B
          ws.FreezePanes = ws.Cells("C5");