How to Convert XLS to XLSX in Java

In this how-to article, we will explain to you how to convert XLS to XLSX in Java. The process of converting a document from one spreadsheet format to another is fairly straightforward and can be accomplished with only a few lines of code. Convert XLS to XLSX using Java does not require any third-party software or even Microsoft Office.

Steps to Convert XLS to XLSX in Java

  1. Install GroupDocs.Conversion for Java from the Maven repository in Java application
  2. Include a reference to the required classes for performing document conversion
  3. Load the source XLS file by creating an instance of the Converter class
  4. Create an instance of the SpreadsheetConvertOptions class for setting convert options for the converted XLSX file
  5. Call Converter.Convert method, pass required parameters, and save the output file to the disk

Here you can see the steps for performing document conversion for Spreadsheet formats. Following the aforementioned points and using only a few API calls, Java convert XLS to XLSX capability can be implemented. These instructions can be used to convert documents by anyone with a basic understanding of the Java language.

Code to Convert XLS to XLSX in Java

We have developed this example to show you how to implement the convert XLS to XLSX Java feature by using the above steps. This sample code focuses on basic document conversion and saves the output file without applying extra settings. However, you may also use this example as a template for your projects and enhance it to perform complex document conversions. Moreover, you can transform XLS format to other document formats such as XLSB, XLAM, SVG, DOCX, PPS, JPEG, and many more.

In this article, we went over the entire process of converting a document from XLS to XLSX format. We recently looked into the process of converting MHTML to PDF documents using Java; for more information, see our guide on how to convert MHTML to PDF in Java.

 English