Opening and saving an Xls removes all document and custom properties


#1

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");
		}

#2

@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.


#3

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

Thanks


#4

Hi again,

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

Regards,

Gary


#5

@GaryO,

Thanks for the details. We will check it soon.


#6

@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.


#7

@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.


#8

@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)


#9

Thanks.

Primilinary testing is good.


#10

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