Freeze panes in excel

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

I have created an Excel worksheet using automation from a
VB.NET application. The worksheet is never made visible by
the VB program. It is created and filled with data from a
database and then some formatting is applied and the
worksheet is saved. I need to know how to freeze panes in
my VB program before the worksheet is saved so when the
saved worksheet is opened, the column headings in the
third row are not scrolled out of view when the user
scrolls the data.
 
Dan,

This is in C# but you should be able to convert it.

YourExcelObject.ActiveWindow.FreezePanes = false;
YourWorksheetObject.get_Range(yourRange).Select();
YourExcelObject.ActiveWindow.FreezePanes = true;
 
Back
Top