Opening and saving an Xls removes all document and custom properties

Hi,

We upgraded from 19.4 to 19.9 and saving an Xls file now is removing all Document and Custom Properties. Saving the same file as XlsX does not have the issue.

Excel Properties.zip (4.8 MB)

I have attached a basic sample EXE with the issue. Please place a license file in the exe directory. It has an XLS file as an internal resource.

  • Click “Original Xls” to save to the exe directory and open in Excel. No Aspose calls)
  • Click “Save As Xls” to save to the exe directory, Open in Aspose.Cells, save as XLS (no processing) and open in Excel.
  • Click “Save As XlsX” to save to the exe directory, Open in Aspose.Cells, save as XLS (no processing) and open in Excel.

You will see that the “Save As Xls” version has no properties anymore. You can see the code used in this form below. the “Save As” buttons just open the file and save. It should not change any properties of the file.

		    private void button1_Click(object sender, EventArgs e)
		{
			File.WriteAllBytes("Test_Document.Xls", Properties.Resources.Test_Document);

			Process.Start("Test_Document.Xls");
		}

		private void button2_Click(object sender, EventArgs e)
		{
			File.WriteAllBytes("Test_Document.Xls", Properties.Resources.Test_Document);

			LoadOptions cellLoadOptions;
			Workbook cellWorkbook = null;

			cellLoadOptions = new LoadOptions(LoadFormat.Excel97To2003);
			cellWorkbook = new Workbook("Test_Document.Xls", cellLoadOptions);

			XlsSaveOptions saveOptions = new XlsSaveOptions(SaveFormat.Excel97To2003);

			cellWorkbook.Save("Test_Document_Saved.Xls", saveOptions);

			cellWorkbook.Dispose();

			Process.Start("Test_Document_Saved.Xls");
		}

		private void button3_Click(object sender, EventArgs e)
		{
			File.WriteAllBytes("Test_Document.Xls", Properties.Resources.Test_Document);

			LoadOptions cellLoadOptions;
			Workbook cellWorkbook = null;

			cellLoadOptions = new LoadOptions(LoadFormat.Excel97To2003);
			cellWorkbook = new Workbook("Test_Document.Xls", cellLoadOptions);

			OoxmlSaveOptions saveOptions = new OoxmlSaveOptions(SaveFormat.Xlsx);

			cellWorkbook.Save("Test_Document_Saved.XlsX", saveOptions);

			cellWorkbook.Dispose();

			Process.Start("Test_Document_Saved.XlsX");
		}

@GaryO,

Thanks for the sample code, EXE file and details.

Could you please provide your source file “Test_Document.Xls” separately also? Using your original file will help us evaluate your issue precisely to consequently figure it out soon.

Hi Amjad, just click “Original Xls”for the original file. It’s just stored as a resource in the exe.

Thanks

Hi again,

I just went thought the releases and this defect was introduced in 19.7.

Regards,

Gary

@GaryO,

Thanks for the details. We will check it soon.

@GaryO,

After an initial test, I am able to reproduce the issue as you mentioned by using your sample code with your template file. I found that by opening and saving the XLS file removes all documents and custom properties, it works fine though when re-saving to XLSX file format. I have logged a ticket with an id “CELLSNET-46933” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

@GaryO,
This is to inform you that we have fixed your issue (logged earlier as “CELLSNET-46933”) now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

@GaryO,
Please try our latest version/fix: Aspose.Cells for .NET v19.9.2 (attached)

Your issue should be fixed in it.

Let us know your feedback.
Aspose.Cells19.9.2 For .Net2_AuthenticodeSigned.Zip (4.9 MB)
Aspose.Cells19.9.2 For .Net4.0.Zip (5.0 MB)

Thanks.

Primilinary testing is good.

@GaryO,
Thanks for feedback. Let us know if you notice any issue.

The issues you have found earlier (filed as CELLSNET-46933) have been fixed in Aspose.Cells for .NET v19.10 (Dlls). This message was posted using Bugs notification tool by Amjad_Sahi