Excel 2013 doesn't allow me to freeze panes RRS feed

  • Question

  • Hello community, this is my first post, so I'll try to be explain the problem the maximum that I can.

    I did a macro in Excel 2010, and at some point of the code I needed to freeze panes, the first line of a worksheet

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

    So my excel was updated to 2013, then this part of the code doesn't run
    It shows me a message that the window property can not be used.

    Besides the freeze panes option in excel is greyed out, and when I try to protect the workbook, I can protect the structure but not the window 

    My page layout is normal (this was the problem of every search I did) and my worbook and worksheet isn't protected

    If I run the macro in other pc with excel 2010, the macro works normaly

    And if I open a new workbook in excel 2013 I can freeze panes, but not in my macro

    Can someone please help me???

    Thursday, June 16, 2016 7:27 PM

All replies

  • Is the Split button in the Windows group of the View tab of the Ribbon highlighted? If so, click to unhighlight it.

    The following should be sufficient to freeze panes below row 1:

        ActiveWindow.FreezePanes = True

    The option to protect a workbook for windows is not available any more in Excel 2013 and later, since each Excel window acts like an individual application window. The windows aren't confined within a single Excel application window, so protecting for windows doesn't make sense.

    Regards, Hans Vogelaar (

    Thursday, June 16, 2016 7:45 PM
  • Hans, thank you for trying to help me

    The "Split button" in the Window group of the Wiew tab is desable, I can't highlight or unhighlight it.

    As a solution I used the code bellow

    If Application.Version < "15.0" Then

            ActiveWindow.FreezePanes = True        

    End If

    This is not the best solution, the freeze pane will only activate if the excel version is bellow 2013

    At least my macro will run with no error, but I still wondering what is happening

    PS: There are only two buttons activated in the window group: Organize and hide

    Friday, June 24, 2016 8:07 PM
  • Does it work in the SAME workbook if you open it in Excel 2010, but not if you open that same workbook in Excel 2013? Your code works without problem for me in Excel 2016...

    Regards, Hans Vogelaar (

    Friday, June 24, 2016 8:41 PM
  • Exactly, I opened the same file in Excel 2010 and in Excel 2013, and it only works in 2010 version. It is a business project, about 10 people will use it, some with 2010 version and others with 2013, we don't have Excel 2016 yet... 

    I created a new worksheet on the project, I still can't freeze panes..

    Looking for solutions I saw it is a commom problem in Excel 2013, with a commom solutuion (Change the view to "Normal View"), but it is not my case

    Thank you

    Friday, June 24, 2016 9:03 PM
  • When sharing files between versions it is important that both versions (Excel 2010 and Excel 2013) have the latest updates applied. If they have fine, move on.

    If not, install all updates to both (Service Packs and latest updates), open the file in 2010 again then save as to a new file. Open in 2013 and test again.

    Not much point chasing bugs that might have been fixed years ago.

    Rod Gill
    Author of the one and only Project VBA Book

    Friday, June 24, 2016 10:35 PM
  • Does the code work on a different worksheet or a different workbook?

    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services, Inc.
    Peltier Tech Blog

    Thursday, June 30, 2016 1:06 PM
  • Is it possible for you to share your workbook here, hiding/changing confidential business data?

    The only problem I recall freezing panes in Excel 2013/2016 is having to use:

    Application.Goto Rows("2:2")

    Instead of:

    But that wouldn't cause an error. The fact that freezing panes is greyed out is also strange. -

    Thursday, June 30, 2016 2:11 PM
  • There should be no need to select any cells. Use code like this:

    Sub FreezeMyPanes()
      Const sFreezeCell As String = "A2" ' top left of unfrozen pane
      With ActiveWindow
        .SplitColumn = .ActiveSheet.Range(sFreezeCell).Column - 1
        .SplitRow = .ActiveSheet.Range(sFreezeCell).Row - 1
        .FreezePanes = True
      End With
    End Sub

    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services, Inc.
    Peltier Tech Blog

    Thursday, June 30, 2016 7:26 PM