We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Adding formula reference to different sheet results in corrupted Excel workbook

Hi,

Using Aspose Cells for Java, version 20.6.
Sample code:

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.getWorksheets().add("TG0702.T07.02");
worksheet.getCells().get(0, 0).setValue(2L);
Worksheet worksheet1 = workbook.getWorksheets().get(0);
worksheet1.getCells().get(0, 0).setFormula("='TG0702.T07.02'!A1 + 1");
workbook.save("demo.xlsx");

Resulting workbook file attached:
demo.zip (6.5 KB)

Opening this workbook in Excel 365 triggers the “Corrupted workbook / recovery” dialog of Excel.

Kind regards,
Taras

@TarasTielkes,

Please notice we were able to reproduce the issue as you mentioned by using your sample code. We found by adding formula reference to different sheet results in corrupted Excel workbook. MS Excel prompts an error message when opening the output file into it. We have logged a ticket with an id “CELLSJAVA-43219” for your issue. We will look into it soon.

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

@TarasTielkes,

We evaluated your issue further and found it is not an issue with Aspose.Cells APIs. If you create such a workbook in MS Excel manually, after saving and re-opening the file, you will get the same error. We do not know the reason, maybe the sheet name is special for MS Excel.

@Amjad_Sahi,

That does not seem right. Using Excel 365, following the steps in the sample code, I can create a workbook that can be saved and re-opened successfully.

The resulting workbook can be opened successfully in both Excel 2010 and Excel 365.

Kind regards,
Taras

@TarasTielkes,

Generally, we follow MS Excel standards and specifications. So, could you perform your task in MS Excel (2007-2019)?

Let us know your feedback.

Hi @Amjad_Sahi,

Can you clarify a bit? Excel 365 is MS Excel.

Thank in advance,
Taras

@TarasTielkes,

We meant, could you perform the task in desktop based MS Excel (application) versions, e.g 2003, 2007, 2010, 2013, 2016, etc.?

@TarasTielkes,
We have checked the scenario by creating the similar file in MS Excel 365 and observed that correct file is created which can be reopened without any error. We are further investigating the issue and will share our feedback when ready.

@TarasTielkes,

We found only Excel 365 can create the correct file but other versions of MS Excel will create the corrupted file. Anyways, we will fix the issue to make the generated file same with the one generated by Excel 365.

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

@TarasTielkes,
Please try our latest version/fix: Aspose.Cells for Java v20.6.5:
aspose-cells-20.6.5-java.zip (7.1 MB)

Your issue should be fixed in it.

Let us know your feedback.

Hi @ahsaniqbalsidiqui,

Aspose Cells for Java, version 20.6.5 does indeed fix the problem reported.

Thank you,
Taras

@TarasTielkes,

Good to know that your issue is sorted out by the new fix. In the event of further queries or issue, feel free to write us back and we will be happy to assist you soon.

The issues you have found earlier (filed as CELLSJAVA-43219) have been fixed in Aspose.Cells for Java 20.7. This message was posted using Bugs notification tool by Amjad_Sahi