UnsolvedCoding
Technical User
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?
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?