Convert a XLS file to XLSX in C#
API
PUT
https://api.aspose.cloud/v3.0/cells/convert
Converting file formats from XLS to XLSX is a complex task. All XLS to XLSX format transitions is performed by our C# SDK while maintaining the source XLS spreadsheet's main structural and logical content. Our C# library is a professional solution to convert XLS to XLSX files online. This Cloud SDK gives C# developers powerful functionality and perfect XLSX output.
Code example in C# using REST API to convert XLS to XLSX format
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/
string name = "Book1.xls";
string format = "xlsx";
string password = null;
string outPath = null;
string storageName = null;
string destFile = "Book1.xlsx";
CellsApi cellsApi = new CellsApi(Environment.GetEnvironmentVariable("ProductClientId"), Environment.GetEnvironmentVariable("ProductClientSecret"));
using (Stream stream = cellsApi.CellsWorkbookPutConvertWorkbook(File.OpenRead(name), format, password, outPath, storageName))
{
using (Stream outStream = File.OpenWrite(destFile))
{
stream.CopyTo(outStream);
}
}
How to use C# API to convert XLS to XLSX
- Create an account at Dashboard to get free API quota & authorization details
- Initialize CellsApi with Client Id, Client Secret, Base URL & API version
- Call CellsWorkbookPutConvertWorkbook method to get the resultant stream
System Requirements
- NET Framework 4.5.2 or newer
- Net Standard 2.0 or newer