title: Copying Styles from one Excel Workbook to another
body: <p>I want to copy one sheet of a workbook (including the styles) to a new workbook.</p>
  
  <p>I tried iteration over all Cells and</p>
  
  <pre><code>CellStyle newCellStyle = workbook.createCellStyle();
  newCellStyle.cloneStyleFrom(oldCell.getCellStyle());
  newCell.setCellStyle(newCellStyle);
  </code></pre>
  
  <p>throws
  java.lang.IllegalStateException: The maximum number of cell styles was exceeded. You can define up to 4000 styles in a .xls workbook</p>
  
  <pre><code>CellStyle newCellStyle = oldCell.getCellStyle();
  newCell.setCellStyle(newCellStyle);
  </code></pre>
  
  <p>throws
  java.lang.IllegalArgumentException: This Style does not belong to the supplied Workbook. Are you trying to assign a style from one workbook to the cell of a differnt workbook?</p>
  
  <p>What is the correct way to copy the styles?</p>