Free Support Forum -

CalculateData function of the PivotTable gives an error

Hi Support,
Using a Pivot table with the “Merge and center cells with labels” flag checked (in the PivotTable Options) and without subtotals and total the execution of the “CalculateData” function gives the error: “Cells in range L10:L12 cannot be merged because cells in range L7:L12 have already been merged”.
I attached a program to replicate the issue. (104.3 KB)


Thanks for using Aspose APIs.

We were able to observe this issue as per your description and logged it in our database for investigation and for a fix. Once, the issue is resolved or we have some other news for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-45975 - Cells in range L10:L12 cannot be merged - Exception occurs while refreshing Pivot Table in Sheet2


Workbook wb = new Workbook("Sample.xlsx"); 



Aspose.Cells.CellsException was unhandled
  Message=Cells in range L10:L12 cannot be merged because cells in range L7:L12 have already been merged.
       at     . (Cells  , Int32  , Int32  , Int32  , Int32  )
       at     .  ()
       at     .  ()
       at     . ( ​   )
       at Aspose.Cells.Pivot.PivotTable.CalculateData()
       at Aspose.Cells.Worksheet.RefreshPivotTables()


Thanks for using Aspose APIs.

This is to inform you that we have fixed your issue CELLSNET-45975 now. We will soon provide the fix after performing QA and including other enhancements and fixes.


Please try our latest version/fix: Aspose.Cells for .NET v18.3.2

Your issue should be fixed in it.

Let us know your feedback.

The issues you have found earlier (filed as CELLSNET-45975) have been fixed in Aspose.Cells for .NET 18.4. Please also check the document/article for your reference: