| title | How to unfreeze the rows and columns in XlsIO | XlsIO | Syncfusion |
|---|---|
| description | This page demonstrates with an example to unfreeze the rows and columns using Syncfusion .NET Excel library (XlsIO). |
| platform | document-processing |
| control | XlsIO |
| documentation | UG |
You can unfreeze rows and columns in XlsIO by using the RemovePanes method. The following code snippet illustrates this.
{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" %}
using (ExcelEngine excelEngine = new ExcelEngine())
{
IApplication application = excelEngine.Excel;
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx", ExcelOpenType.Automatic);
IWorksheet worksheet = workbook.Worksheets[0];
//Freeze the panes worksheet.Range[8, 1].FreezePanes();
//Unfreeze the panes worksheet.RemovePanes();
workbook.SaveAs("Unfreeze.xlsx"); workbook.Close(); excelEngine.Dispose(); } {% endhighlight %}
{% highlight c# tabtitle="C# [Windows-specific]" %} using (ExcelEngine excelEngine = new ExcelEngine()) { IApplication application = excelEngine.Excel; application.DefaultVersion = ExcelVersion.Excel2013; IWorkbook workbook = application.Workbooks.Open("Sample.xlsx", ExcelOpenType.Automatic); IWorksheet worksheet = workbook.Worksheets[0];
//Freeze the panes worksheet.Range[8, 1].FreezePanes();
//Unfreeze the panes worksheet.RemovePanes();
workbook.SaveAs("Unfreeze.xlsx"); } {% endhighlight %}
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} Using excelEngine As ExcelEngine = New ExcelEngine() Dim application As IApplication = excelEngine.Excel application.DefaultVersion = ExcelVersion.Excel2013 Dim workbook As IWorkbook = application.Workbooks.Open("Sample.xlsx", ExcelOpenType.Automatic) Dim worksheet As IWorksheet = workbook.Worksheets(0)
'Freeze the panes worksheet.Range(8, 1).FreezePanes()
'Unfreeze the panes worksheet.RemovePanes()
workbook.SaveAs("Unfreeze.xlsx") End Using {% endhighlight %} {% endtabs %}