try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); workbook.write(bos); byte[] barray = bos.toByteArray(); InputStream is = new ByteArrayInputStream(barray); } catch (IOException e) { e.printStackTrace(); }