We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set Freeze panes in Excel using C#,VB.NET?

Platform: WinForms |
Control: XlsIO |
Published Date: April 30, 2011 |
Last Revised Date: March 16, 2018

This article explains how to set freeze panes in Excel using C#/VB.NET.

How to set freeze panes in Excel?

Rows and columns can be frozen using IRange.FreezePanes() method. To freeze the rows or columns one must call the freeze panes by the range with next column and row.

For example, when we need to freeze first row we need to select range “A2”. If we select range “B2”, then the first row and first column will be freeze in worksheet. So, we need to select the range next to the range that needs to be frozen.

To set a freeze pane, you need to follow the below steps.

Steps to set freeze panes

  1. Create a workbook.

 

  1. Select the range to create freeze pane. Create a freeze pane using IRange.FreezePanes() method.

 

  1. Save the workbook.

 

To know more about freeze panes, please refer the documentation.

Download complete sample

The following C#/VB.NET complete code snippet shows how to set freeze panes in Excel using XlsIO.

 

 

The following screenshot shows the output Excel document with freeze panes generated using XlsIO.

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon