I am trying to use vba to freeze panes. I am looping through 5 sheets , the first four sheets work. When I et to the last sheet that is when I get my error 438. Any help would be appreciated. I have highlighted in red where I get the error.
Code:
If iSheetCount < 5 Then goXL.ActiveSheet.Range("C4").Select
If iSheetCount < 5 Then goXL.ActiveWindow.FreezePanes = True
If iSheetCount = 5 Then goXL.ActiveSheet.Rows("2:2").Select
[red] If iSheetCount = 5 Then goXL.ActiveWindow.FreezePane = True [/red]