Freeze panes in excel

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.
 
S

Scott Glasgow

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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top