// Create a png file stream FileOutputStream outputStream = null; try { outputStream = new FileOutputStream("ExportRangeToImage.png"); } catch (FileNotFoundException e) { e.printStackTrace(); } // Create a new workbook Workbook workbook = new Workbook(); // Open an excel file InputStream fileStream = this.getResourceStream("xlsx/Personal Monthly Budget.xlsx"); workbook.open(fileStream); IWorksheet worksheet = workbook.getWorksheets().get(0); // Export range "B14:E25" to image worksheet.getRange("B14:E25").toImage(outputStream, ImageType.PNG); // Close the file stream try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); }