Excel produces invalid xls file when converting xlsx file created by Aspose.Cells

Hello,

I am using Aspose.Cells to create Excel files (in xlsx format) from XML Spreadsheet format but users have discovered that when opening the xlsx file in Excel and saving to xls format, the xls file seems to be corrupted. When the file is opened in Excel again, the user gets a warnng in the header (See attached picture).

I have provided the following files to reproduce the problem

  • xmlSpreadsheet.xml: File loaded into Workbook from stream
  • Excel2010.xlsx: File saved to stream using Workbook object.
  • Excel2003.xls: File Saved from Excel using Save As-> Excel 97-2003 Workbook.

thanks,

Henrik (Developer at Genus AS)

Hi,

Please download and try this fix: Aspose.Cells for .NET v7.1.2.4

If you still find the issue, kindly do provide us the sample code to reproduce the issue on our end.


Thank you.

Hello,

and thanks for your reply! I did not manage to install the new DLL (I am running .Net Framework 4 Client Profile) but tried the latest Aspose.Cells for .Net that is published (v7.1.2.0) and still got the same error. Please see files attached in the first post in this thread for data to reproduce the error.

thanks,

Henrik (Developer at Genus AS)

Hi,

Thanks for your testing.

Please share your sample code with us.

We will test it with the latest version and if the problem is resolved, we will request for a client profile version.

In case, if the problem still occurs, we will create an issue against it in our database.

Hello,

I cannot share the entire source code but the fragment loading and converting looks like this:

Workbook l_workbook;

// Create MemoryStream with XML Spreadsheet
using (var l_stream = new MemoryStream(spreadsheetData))
{
l_workbook = new Workbook(l_stream);
}

l_workbook.CalculateFormula();

using (var l_resultStream = new MemoryStream())
{
var l_saveOptions = new OoxmlSaveOptions { ExportCellName = true, SaveFormat = SaveFormat.Xlsx }
l_workbook.Save(l_resultStream, l_saveOptions);
}

However, I would guess that it pplies to any xlsx file created from Aspose.Cells - when opened in Excel 2010 and saved again as xls, the file has an error that causes Excel 2010 to produce the warning showed in the first post.

thanks,

Henrik ( Developer at Genus AS)

Hi,

Thanks for your code example.

I was not able to reproduce this issue with your code by using the latest version:
Aspose.Cells
for .NET v7.1.2.4



Please see the code below and the output xlsx file generated by it.

We will provide you a client profile version soon (tomorrow).

C#


string filePath = @“F:\Shak-Data-RW\Downloads\xmlSpreadsheet.xls”;


Workbook l_workbook;


// Create MemoryStream with XML Spreadsheet

using (var l_stream = new MemoryStream(File.ReadAllBytes(filePath)))

{

l_workbook = new Workbook(l_stream);

}


l_workbook.CalculateFormula();


using (var l_resultStream = new MemoryStream())

{

var l_saveOptions = new OoxmlSaveOptions(SaveFormat.Xlsx) { ExportCellName = true };


l_workbook.Save(l_resultStream, l_saveOptions);


File.WriteAllBytes(filePath + “.out.xlsx”, l_resultStream.ToArray());

}



Hi,

Please download and latest version in client profile build: Aspose.Cells For .NetClient v7.1.2.4

Hello,

I have now tried to run the test code you provided with the latest build of Aspose.Cells (v7.1.2.4) but the problem still persists.

I am using the file provided in the first post, a file in XML Spreadsheet format created in Excel 2010, and converts this file to xlsx format. That file opens without problem in Excel 2010, but when i try to save that file to xls format (from Excel 2010, File ->Save As->*.xls) the resulting file is corrupted and Excel will issue a warning when that file is reopened in Excel.

thanks,

Henrik (Developer at Genus AS)

Hello,

must add that if I open the file you provided (xmlSpreadsheet.xls.out.xlsx) in Excel 2010 and save it back to xls format, I get the same problem..

thanks,

Henrik (Developer at Genus AS)

Hi,

Thanks for your feedback.

We have logged this issue in our database for investigation.

We will look into it further and resolve the problem.

Once, the issue is fixed or we have some update relating to it, we will let you know asap.

This issue has been logged as CELLSNET-40533.

Hi,

We have. fixed this issue. Please download: Aspose.Cells for .NET v7.1.2.5

Hello,

and thanks for your quick fix. Do you have available a versjon for .Net 4 Client Profile too? And are these versjons you publish here in the forums production builds or "beta" builds?

thanks,

Henrik (Developer at Genus AS)

Hi,

These are minor releases and meant for productions.

Each newer minor release includes the fixes of previous releases and at the end of month, we publish a major release that includes all the previous fixes of all the minor releases alongwith release notes.

So the only difference between minor and major releases are that major release also have release notes and other support materials.

Sure, we will provide you a build for client profile soon, but you will have to wait for it for next few days.

Hi,

Please download and use the latest Client Profile version: Aspose.Cells for .NET v7.1.2.6 (Client Profile)

The issues you have found earlier (filed as CELLSNET-40533) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.