code: def max_dimension(cellmap, sheet = None):
      
  
      cells = list(cellmap.values())
      rows = 0
      cols = 0
      for cell in cells:
          if sheet is None or cell.sheet == sheet:
              rows = max(rows, int(cell.row))
              cols = max(cols, int(col2num(cell.col)))
  
      return (rows, cols)
docs: This function calculates the maximum dimension of the workbook or optionally the worksheet. It returns a tupple
      of two integers, the first being the rows and the second being the columns.
  
      :param cellmap: all the cells that should be used to calculate the maximum.
      :param sheet:  (optionally) a string with the sheet name.
      :return: a tupple of two integers, the first being the rows and the second being the columns.