code: public static Workbook createWorkbook(FileFormat format, OutputStream os, Workbook existing)
          throws IOException
      {
          Workbook ret = null;
          if(format == FileFormat.XLS)
          {
              ret = XlsWorkbook.createWorkbook(os, existing);
          }
          else if(format == FileFormat.XLSX)
          {
              XlsxWorkbook.initJaxbContexts();
              ret = XlsxWorkbook.createWorkbook(os, existing);
          }
          return ret;
      }
docs: Creates a new workbook object.
  @param format The format of the workbook (XLS or XLSX)
  @param os The output stream to write the workbook to
  @param existing An existing workbook to add to
  @return The new workbook created
  @throws IOException if the file cannot be written