Hi I am trying to set formula in a worksheet which references cells from other workbook's multiple worksheets. I am using aspose.cells.java version 8.2.1.3
and that formula gets set using setFormula function
totalCell.setFormula(formula) and
But I noticed that totalCell has formula as follows -which is incorrect - my question is why does aspose changes the formula e.g. [1.xlsx]ALL_0011_2!E65 ====> 'c:\Rita\40\[1.xlsx]ALL_0011_2:ALL_0010_1'!C65
Please download and try the latest version: Aspose.Cells
for Java v8.5.1.6 and see if it makes any difference and resolves your issue.
If your issue still occurs, then please provide us your runnable sample code and source excel file. Please also provide us your actual and expected excel files. You can create expected excel file manually using Microsoft Excel and attach it here fore our reference.
We will look into your issue and help you asap. Thanks for your cooperation.
Thank you for your prompt response. I tried the code with the new version that you provided Aspose.Cells for Java v8.5.1.6 - and I noticed the same issue. Please take a look at attached sample code and files that are used in the code for formula.
1.xlsx and 2.xlsx are sample workbooks and AsposeCellsJava8516test.txt contains the java code.
We were able to observe this issue by executing the following code with the latest version: Aspose.Cells
for Java v8.5.1.6. When the formula is inserted manually using Microsoft Excel, it evaluates to 0 but when it is inserted using Aspose.Cells API, it evaluates to #REF! which is wrong and means formula is getting changed.
We have logged this issue in our database for investigation. We will look into it and fix this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.
This issue has been logged as
CELLSJAVA-41443 - Excel formula issue- formula is getting changed on setFormula function
I have also attached the output excel file generated with the following code for a reference.
Good to know that the suggested code works fine for your requirements. Feel free to write us back if have further queries or comments, we will be happy to assist you soon.