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 Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using vba to freeze panes error 438 1

Status
Not open for further replies.

vba317

Programmer
Mar 5, 2009
708
US
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]
 
How 'bout

Code:
If iSheetCount = 5 Then goXL.ActiveWindow.FreezePane[b][red]s[/red][/b] = True
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top