Various versions of MS Excel are available and being used around the world. This makes it possible that the newer versions provide features that may not be available in the older ones. Therefore, MS Excel uses compatibility checker to degrade the features which are not supported by an older format when saving the files. While manipulating Excel files, you may need to disable the compatibility checker dynamically. To achieve it, this article shows how to disable the compatibility checker for MS Excel workbooks in Java.
Java Library to Disable Compatibility Checker in Excel
Aspose.Cells for Java provides a wide range of features for spreadsheet manipulation. Using the API, you can create new spreadsheet documents from scratch and manipulate the existing ones. We will use this API to disable the compatibility checker for Excel files. You can download the API’s JAR or install it using the following Maven configurations.
<repository> <id>AsposeJavaAPI</id> <name>Aspose Java API</name> <url>https://repository.aspose.com/repo/</url> </repository> <dependency> <groupId>com.aspose</groupId> <artifactId>aspose-cells</artifactId> <version>21.11</version> </dependency>
Disable Compatibility Checker in Excel Files
In order to disable the compatibility checker for an Excel workbook, you need to update the workbook’s settings. The following are the steps to perform this operation.
- First, load the Excel file using Workbook class.
- Then, disable compatibility checker using Workbook.getSettings().setCheckCompatibility(boolean) method (set true and false to enable and disable checker, respectively).
- Finally, save the updated workbook using Workbook.save(string) method.
The following code sample shows how to disable the compatibility checker using Java.
Get a Free License
You can use Aspose.Cells for Java without evaluation limitations using a temporary license.
MS Excel compatibility checker allows the users to create documents that can be viewed by everyone without compatibility issues. While working with Excel files programmatically, you may need to disable compatibility checker. Therefore, in this article, you have learned how to enable or disable compatibility checker for Excel files using Java. Besides, you can also explore other features of Aspose.Cells for Java using the documentation. In case you would have any queries, you can post on our forum.