MS Excel is a widely used spreadsheet application, which is available in different versions. Therefore, compatibility issues may occur when opening a file having the latest features in an older version of MS Excel. MS Excel contains a compatibility checker, which is executed when saving the files. It verifies that newer features, which are not supported by the older formats, are not used in the file. However, in certain cases, you have to disable the compatibility checker. In this article, you will learn how to disable the compatibility checker for MS Excel workbooks in C#.
C# Library to Disable Compatibility Checker in Excel
Aspose.Cells for .NET is a popular spreadsheet manipulation API that allows you to create spreadsheet files from scratch. Also, it lets you manipulate existing Excel files quite easily. We will use this API to disable the compatibility checker for Excel files. You can download the API’s DLL or install it using NuGet.
PM> Install-Package Aspose.Cells
Disable Compatibility Checker in Excel Files
The compatibility checker for an Excel file can be disabled by updating the workbook’s settings. The following are the steps to achieve that.
- First, use Workbook class to load the desired Excel file.
- Then, use Workbook.Settings.CheckCompatibility property to disable the compatibility checker (set true and false to enable and disable checker, respectively).
- Finally, save Excel file using Workbook.Save(string) method.
The following code sample shows how to disable the compatibility checker using C#.
Get a Free License
You can use Aspose.Cells for .NET without evaluation limitations using a temporary license.
Conclusion
While manipulating Excel files from within your .NET applications, you may need to disable the compatibility checker. To achieve that, in this article, you have learned how to enable or disable the compatibility checker for Excel files using C#. Apart from that, you can explore other features of Aspose.Cells for .NET using the documentation. In addition, you can post your questions and queries on our forum.