Aspose version: Aspose.Cells 20.3
Excel Version: Microsoft Office 2016 (16.0.4939.1000) 32 bit
Code snippet
import com.aspose.cells.*;
public class WorkbookFormulasBug {
public static void main(String[] args) throws Exception {
License license = new License();
license.setLicense("aspose.lic");
Workbook workbookTemplate = new Workbook("template.xltm");
Workbook workbookPivotSource = new Workbook("pivotsource.xlsm");
// Copy Pivot data
for (int i = 0; i < workbookPivotSource.getWorksheets().getCount(); i++) {
Worksheet pivotWorksheet = workbookPivotSource.getWorksheets().get(i);
Worksheet templateWorksheet = workbookTemplate.getWorksheets().get(pivotWorksheet.getName());
templateWorksheet.copy(pivotWorksheet);
}
workbookTemplate.save("generated_report.xlsm");
}
}
Code snippet source files
Steps to reproduce bug:
- Generate report using code snippet. You can see that cells with formulas has #N/A value, but should have calculated value.
Screenshot with description
img
Normal behavior (after generation using old Aspose.Cells 17.10):
- Generate report using code snippet. You can see that cells with formulas has calculated values by default.
Screenshot with description
img
Expected output file: generated_report.xlsm
We catch this bug after upgrade from 17.10 to 20.3.
P.S. Our client (which use this report) is not considering to update Excel.