Help with Excel FreezePanes from code

L

lanem

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

Tom Ogilvy

Dim xl As Worksheet

Set xl = Activesheet
xl.Selection.Cells(2, 2).Activate()
xl.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