No announcement yet.

Freeze panes in Excel

  • Filter
  • Time
  • Show
Clear All
new posts

  • Freeze panes in Excel

    I want to freeze the second row of a worksheet. In I found the FreezePanes Member. I do not succeed to call this function whith the right paramaters. Who can help me?

  • #2
    What I know, you can not freeze row 2 in an Excel sheet, but well row 1 + row 2.
    /Fim W.
    Fim Wästberg


    • #3
      I ment to freeze Row 1.


      • #4
        You really need to show the failing code.

        By my search you need to be setting the FreezePanes property of the desired Window object of the Windows collection of the Application object.... which you may or may not be doing. (Code not shown!)

        Often times the easiest way to know what objects, properties and methods to work with in what order is best determined by turning on the Excel Macro recorder, doing <whatever> by hand, turning off the macro recorder and then calling up the generated VBA script.

        While that will not be PB syntax, it will get you pretty close and for sure will get you the correct sequence in which to do things... which is not always intuitive when working with MS-Excel. ( Well, not intuitive for me, anyway), .

        BUT... for sure if you need more help with this you need to post the failing code.


        Michael Mattias
        Tal Systems Inc.
        Racine WI USA


        • #5
          Here is how I achieved that in a 2012 application (to freeze one row and one column):

            DIM vRange          AS VARIANT
            DIM vBool           AS VARIANT
            LET vRange="B2:B2"
            OBJECT CALL oExcelWorkSheet.Range(vRange).SELECT
            LET vBool = 1
            OBJECT LET oExcelApp.ActiveWindow.FreezePanes = vBool
          Hope this help.
          Julien Tosoni - Goodyear Dunlop Tires France


          • #6
            Thaks Julien,

            this is what I needed! (Let vRange = "2:2" to freeze the top row)