Table of Contents

Class WorksheetFreezePaneExtensions

Namespace
Openize.Cells
Assembly
Openize.OpenXMLSDK.dll

Provides extension methods for easy management of freeze panes in Excel worksheets.

public static class WorksheetFreezePaneExtensions
Inheritance
WorksheetFreezePaneExtensions
Inherited Members

Methods

FreezeFirstColumn(Worksheet)

Freezes the first column of the worksheet.

public static Worksheet FreezeFirstColumn(this Worksheet worksheet)

Parameters

worksheet Worksheet

The worksheet.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.

FreezeLeftColumns(Worksheet, int)

Freezes the specified number of leftmost columns.

public static Worksheet FreezeLeftColumns(this Worksheet worksheet, int columnCount)

Parameters

worksheet Worksheet

The worksheet.

columnCount int

The number of columns to freeze.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.

ArgumentOutOfRangeException

Thrown when columnCount is negative.

FreezePanesAt(Worksheet, string)

Freezes the panes at a specified cell position, freezing all rows above and all columns to the left of the cell.

public static Worksheet FreezePanesAt(this Worksheet worksheet, string cellReference)

Parameters

worksheet Worksheet

The worksheet.

cellReference string

The cell reference (e.g., "B3") indicating the position for the freeze pane.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet or cellReference is null.

FormatException

Thrown when cellReference format is invalid.

FreezeTopRow(Worksheet)

Freezes the top row of the worksheet.

public static Worksheet FreezeTopRow(this Worksheet worksheet)

Parameters

worksheet Worksheet

The worksheet.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.

FreezeTopRowAndFirstColumn(Worksheet)

Freezes both the top row and first column of the worksheet.

public static Worksheet FreezeTopRowAndFirstColumn(this Worksheet worksheet)

Parameters

worksheet Worksheet

The worksheet.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.

FreezeTopRows(Worksheet, int)

Freezes the specified number of top rows.

public static Worksheet FreezeTopRows(this Worksheet worksheet, int rowCount)

Parameters

worksheet Worksheet

The worksheet.

rowCount int

The number of rows to freeze.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.

ArgumentOutOfRangeException

Thrown when rowCount is negative.

UnfreezePanes(Worksheet)

Removes all freeze panes from the worksheet.

public static Worksheet UnfreezePanes(this Worksheet worksheet)

Parameters

worksheet Worksheet

The worksheet.

Returns

Worksheet

The worksheet for method chaining.

Exceptions

ArgumentNullException

Thrown when worksheet is null.