Worksheet.FreezePanes

FreezePanes(int, int, int, int)

Freezes panes at the specified cell in the worksheet.

public void FreezePanes(int row, int column, int freezedRows, int freezedColumns)
ParameterTypeDescription
rowInt32Row index.
columnInt32Column index.
freezedRowsInt32Number of visible rows in top pane, no more than row index.
freezedColumnsInt32Number of visible columns in left pane, no more than column index.

Remarks

Row index and column index cannot all be zero. Number of rows and number of columns also cannot all be zero.

The first two parameters specify the froze position and the last two parameters specify the area frozen on the left top pane.

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class WorksheetMethodFreezePanesWithInt32Int32Int32Int32Demo
    {
        public static void Run()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            
            // Access the first worksheet
            Worksheet worksheet = workbook.Worksheets[0];
            
            // Freeze panes at row 3, column 3, with 3 frozen rows and 3 frozen columns
            worksheet.FreezePanes(3, 3, 3, 3);
            
            // Save the workbook
            workbook.Save("FreezePanesDemo.xlsx");
        }
    }
}

See Also


FreezePanes(string, int, int)

Freezes panes at the specified cell in the worksheet.

public void FreezePanes(string cellName, int freezedRows, int freezedColumns)
ParameterTypeDescription
cellNameStringCell name.
freezedRowsInt32Number of visible rows in top pane, no more than row index.
freezedColumnsInt32Number of visible columns in left pane, no more than column index.

Remarks

Row index and column index cannot all be zero. Number of rows and number of columns also cannot all be zero.

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class WorksheetMethodFreezePanesWithStringInt32Int32Demo
    {
        public static void Run()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();

            // Access the first worksheet
            Worksheet worksheet = workbook.Worksheets[0];

            // Freeze panes at "C3" with 3 frozen rows and 3 frozen columns
            worksheet.FreezePanes("C3", 3, 3);

            // Save the workbook
            workbook.Save("FreezePanesDemo.xlsx");
        }
    }
}

See Also