title: Setting max column width for autoSizeColumn with Apache POI
body: <p>We are using <code>autoSizeColumn</code> to autosize each column of each sheet in our workbook.  It works well except that in some cases it yields columns of extremely large widths.  It is not always possible for us to humanly inspect our output to detect such conditions.</p>
  <p>Is there a way to realize the following logic in Apache POI?</p>
  <pre><code>set MAX_COL_WIDTH
  enable auto-column-width
  LOOP
    IF column-width &gt; MAX_COL_WIDTH
    THEN
      disable auto-column-width for sheet
    ENDIF
    reenable auto-column-width
  ENDLOOP
  </code></pre>