Opening Existing Excel sheet in Java using Apache POI Last Updated : 25 Apr, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report Apache POI is a powerful API by which one can read, write and modify any Microsoft document like powerpoint, world, or excel. Apache POI have different classes and method to work upon different MS Office Document. POIFS -It's Stand for "Poor Obfuscation Implementation File System". This component is the basic factor of all other POI elements. It is used to read different files explicitly.HSSF It's Stand for "Horrible Spreadsheet Format". It is used to read and write xls format of MS-Excel files.XSSF It's Stand for "XML Spreadsheet Format". It is used for xlsx file format of MS-Excel.HPSF It's Stand for "Horrible Property Set Format". It is used to extract property sets of the MS-Office files.HWPF It's Stand for "Horrible Word Processor Format". It is used to read and write doc extension files of MS-Word.XWPF It's Stand for "XML Word Processor Format". It is used to read and write docx extension files of MS-Word.HSLF It's Stand for "Horrible Slide Layout Format". It is used for read, create, and edit PowerPoint presentations.HDGF It's Stand for "Horrible Diagram Format". It contains classes and methods for MS-Visio binary files.HPBF It's Stand for "Horrible PuBlisher Format". It is used to read and write MS-Publisher files. Steps to Open Existing Excel Sheet in Java, in eclipse Create a JAVA Maven projectAdd dependency in pom.xml file XML <!-- https://mvnrepository.com/artifact/org.apache.poi/poi --> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.12</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.12</version> </dependency> Create a class in javaResource folder Java import java.io.File; import java.io.FileInputStream; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class GFG { public static void main(String args[]) throws Exception { // Create a file object // for the path of existing Excel file // Give the path of the file as parameter // from where file is to be read File file = new File("Geeks.xlsx"); // Create a FileInputStream object // for getting the information of the file FileInputStream fip = new FileInputStream(file); // Getting the workbook instance for XLSX file XSSFWorkbook workbook = new XSSFWorkbook(fip); // Ensure if file exist or not if (file.isFile() && file.exists()) { System.out.println("Geeks.xlsx open"); } else { System.out.println("Geeks.xlsx either not exist" + " or can't open"); } } } Run the code as java application Output: Geeks.xlsx either not exist or can't open File location in eclipse Comment More infoAdvertise with us Next Article Reading and Writing Data to Excel File in Java using Apache POI S Shahnawaz_Ali Follow Improve Article Tags : Misc Java Functions Practice Tags : FunctionsJavaMisc Similar Reads Creating Sheets in Excel File in Java using Apache POI Apache POI is an open-source java library to create and manipulate various file formats based on Microsoft Office. Using POI, one should be able to perform create, modify and display/read operations on the following file formats. For Example, java doesnât provide built-in support for working with ex 3 min read Reading and Writing Data to Excel File in Java using Apache POI In Java, reading an Excel file is not similar to reading a Word file because of cells in an Excel file. JDK does not provide a direct API to read data from Excel files for which we have to toggle to a third-party library that is Apache POI. Apache POI is an open-source java library designed for read 5 min read How to Create Formula Cell in Excel Sheet using Java and Apache POI? In the previous article, we have seen how to read data from the formula cell, here we are going to create the formula cell using Apache POI. Â In this article, we are creating an Excel file with three columns consisting of values and the last column is the formula cell which is calculated from the o 2 min read How to Create Pivot Table in Excel using Java? A pivot table is needed to quickly analyze data of a table with very little effort (and no formulas) and sometimes not everyone has time to look at the data in the table and see whatâs going on and use it to build good-looking reports for large data sets in an Excel worksheet. Let's discuss a step-b 5 min read How to Write Data from HashMap to Excel using Java in Apache POI? Apache POI is an open-source java library to create and manipulate various file formats based on Microsoft Office. Using POI, one should be able to perform create, modify and display/read operations on the following file formats. For Example, Java doesnât provide built-in support for working with ex 3 min read Creating a Cell at specific position in Excel file using Java Apache POI is an open-source java library to create and manipulate various file formats based on Microsoft Office. Using POI, one should be able to perform create, modify and display/read operations on the following file formats/ it can be used to create a cell in a Given Excel file at a specific po 2 min read Like