ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with Excel FreezePanes from code (https://www.excelbanter.com/excel-programming/362298-help-excel-freezepanes-code.html)

lanem

Help with Excel FreezePanes from code
 
I can't get this to work. Please help. Here's my code:

Dim xl As New Spreadsheet

xl.Selection.Cells(2, 2).Activate()
xl.ActiveWindow.FreezePanes = True

There's no errors . . . it just doesn't set up the FreezePanes stuff.

Tom Ogilvy

Help with Excel FreezePanes from code
 
Dim xl As Worksheet

Set xl = Activesheet
xl.Selection.Cells(2, 2).Activate()
xl.ActiveWindow.FreezePanes = True

--
Regards,
Tom Ogilvy


"lanem" wrote:

I can't get this to work. Please help. Here's my code:

Dim xl As New Spreadsheet

xl.Selection.Cells(2, 2).Activate()
xl.ActiveWindow.FreezePanes = True

There's no errors . . . it just doesn't set up the FreezePanes stuff.


lanem

Help with Excel FreezePanes from code
 
That did not help.

BTW, I'm doing this from ASP.NET 2.0 using VB.NET.

Thanks anyway.

"Tom Ogilvy" wrote:

Dim xl As Worksheet

Set xl = Activesheet
xl.Selection.Cells(2, 2).Activate()
xl.ActiveWindow.FreezePanes = True

--
Regards,
Tom Ogilvy


"lanem" wrote:

I can't get this to work. Please help. Here's my code:

Dim xl As New Spreadsheet

xl.Selection.Cells(2, 2).Activate()
xl.ActiveWindow.FreezePanes = True

There's no errors . . . it just doesn't set up the FreezePanes stuff.



All times are GMT +1. The time now is 05:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com