Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Freeze panes and subtotals 1

Status
Not open for further replies.

UnsolvedCoding

Technical User
Jul 20, 2011
424
US
The particular Excel process being worked on opens multipule workbooks, updates the information and then close out the completed books. The code works, however the freeze panes part of it gives me hesitation because of the phrase ActiveWindow. If possible specifying the workbook and worksheet like in the rest of the code is desired.

The specific workbook is identified as Workbooks(sFileName).Worksheets(sSheetName) in the rest of the code.

I am trying to replace the code for freezing panes that uses ActiveWindow with Workbooks(sFileName).Worksheets(sSheetName).

Working code for freezing panes is this -

With ActiveWindow
.SplitColumn = 0
.SplitRow = 1
End With


and when I try this it fails

With Workbooks(sFileName).Worksheets(sSheetName)
.SplitColumn = 0
.SplitRow = 1
End With

Does anyone know how to I can specify using Workbooks(sFileName).Worksheets(sSheetName) with freeze panes?



 
I'd try this:
With Workbooks(sFileName).Worksheets(sSheetName).Windows(1)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 



hi,

1. SPLIT is not FREEZE. Personally I despise the split feature. The Freeze feature is much cleanerfor purposes of 'locking' title rows/columns, IMNSHO.

2. BOTH are properties of the Window Object.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
PHV -

With Workbooks(sFileName).Worksheets(sSheetName).Windows(1)

failed as well


Skip -

I can't get either split or freeze to work with Workbooks(sFileName).Worksheets(sSheetName)
 
And this ?
With Workbooks(sFileName).Windows(1)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
With Workbooks(sFileName).Windows(1)
.FreezePanes = True
End With


Worked like a charm. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top