def freeze_panes(*args)
      return if args.empty?

      # Check for a cell reference in A1 notation and substitute row and column.
      row, col, top_row, left_col, type = row_col_notation(args)

      col      ||= 0
      top_row  ||= row
      left_col ||= col
      type     ||= 0

      @panes   = [row, col, top_row, left_col, type ]
    end
def freeze_panes(*args)
      return if args.empty?

      # Check for a cell reference in A1 notation and substitute row and column.
      row, col, top_row, left_col, type = row_col_notation(args)

      col      ||= 0
      top_row  ||= row
      left_col ||= col
      type     ||= 0

      @panes   = [row, col, top_row, left_col, type ]
    end
:call-seq:
   freeze_panes(row, col [ , top_row, left_col ] )

 This method can be used to divide a worksheet into horizontal or
 vertical regions known as panes and to also "freeze" these panes so
 that the splitter bars are not visible. This is the same as the
 <tt>Window->Freeze</tt> Panes menu command in Excel

 The parameters +row+ and +col+ are used to specify the location of
 the split. It should be noted that the split is specified at the
 top or left of a cell and that the method uses zero based indexing.
 Therefore to freeze the first row of a worksheet it is necessary
 to specify the split at row 2 (which is 1 as the zero-based index).
 This might lead you to think that you are using a 1 based index
 but this is not the case.

 You can set one of the row and +col+ parameters as zero if you
 do not want either a vertical or horizontal split.

 Examples:

     worksheet.freeze_panes(1, 0)    # Freeze the first row
     worksheet.freeze_panes('A2')    # Same using A1 notation
     worksheet.freeze_panes(0, 1)    # Freeze the first column
     worksheet.freeze_panes('B1')    # Same using A1 notation
     worksheet.freeze_panes(1, 2)    # Freeze first row and first 2 columns
     worksheet.freeze_panes('C2')    # Same using A1 notation

 The parameters +top_row+ and +left_col+ are optional. They are used
 to specify the top-most or left-most visible row or column in the
 scrolling region of the panes. For example to freeze the first row
 and to have the scrolling region begin at row twenty:

     worksheet.freeze_panes(1, 0, 20, 0)

 You cannot use A1 notation for the +top_row+ and +left_col+ parameters.

 See also the panes.rb program in the examples directory of the
 distribution.