This project has moved. For the latest updates, please go here.

how to use FreezePanes

Jul 22, 2010 at 6:07 AM

Hi all,

am facing a problem while using freezepanes.

i am creating a excel.

and i have to fix first 8 rows and i have columns of 15.

am writing like this.

objSheet.View.FreezePanes(1, 15);

objSheet.View.FreezePanes(2, 15);

objSheet.View.FreezePanes(3, 15);

objSheet.View.FreezePanes(4, 15);

objSheet.View.FreezePanes(5, 15);

objSheet.View.FreezePanes(6, 15);

objSheet.View.FreezePanes(7, 15);

objSheet.View.FreezePanes(8, 15);

but 7 rows it is fixing but 8 th row it is not fixing.

and i have 15 columns .

and i have each and every column width.

worksheet.Column(1).Width = 35;

worksheet.Column(2).Width = 20;

worksheet.Column(3).Width = 20;

worksheet.Column(4).Width = 20;

worksheet.Column(5).Width = 20;

worksheet.Column(6).Width = 20;

worksheet.Column(7).Width = 20;

worksheet.Column(8).Width = 20;

worksheet.Column(9).Width = 20;

worksheet.Column(10).Width = 20;

worksheet.Column(11).Width = 20;

worksheet.Column(12).Width = 20;

worksheet.Column(13).Width = 20;

worksheet.Column(14).Width = 20;

worksheet.Column(15).Width = 20;

 

but what happening exactly, is am able to generate excel.

but as i said early 8 row is not freezed.

and due to width am able to see till column F. and than i cant see the values after column F.

even i scroll side it is not working.but i can scroll down.

please tell me how to use FreezePanes option in excelpackage.

Thanks in advance.

 

 

 

Mar 29, 2013 at 5:03 PM
You should just use the following line:

objSheet.View.FreezePanes(9, 16);

That call will freeze everything above and to the left of the specified cell.