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

Free Support Forum - aspose.com

The function shiftRow shifted incorrect reference formula in Java

Hello Aspose team,

I implement function insertCutRow by function shiftRow as below:

public  void  insertCutRows(String sheetName,  short  startRow,  short  endRow,

short  destStartRow) {

String fcn = "insertCutRows( " + sheetName + "," + startRow + ","

+ endRow + "," + destStartRow + ")";

logger .debug(fcn);

Worksheet sheet = workbook.getWorksheets().getSheet(sheetName);

short  delta = 0;

if  (destStartRow > startRow) {

//Truong hop insert cut row down, tru bot n row da cut vi se dich nguoc len n

delta = ( short )(destStartRow - startRow - (endRow - startRow + 1));

sheet.getCells().shiftRows(startRow - 1, endRow - 1, delta);

}  else  {

delta = ( short )(destStartRow - startRow);

sheet.getCells().shiftRows(startRow - 1, endRow - 1, delta);



I tested and saw data, format, image work find. But have problem with shift formula. The formula is shifted wrong. I test function shiftRows and saw it shifted wrong formula. Please see prensentation attachment to view my test case.

I have a question: Is the function shiftRows has bug or I misunderstand and use it for wrong purpose?

Thanks a lots!


Well, using the sample codes pasted on the slides of your template pptx file, I can find the issue you have talked about.

We will figure them out soon.

I have logged it into our issue tracking system with an id: CELLSJAVA-18175.

Thank you.


After further investigation, since it is a
bit complex process to move formulas from one cell to other accordingly. So, we surely need more time to improve the feature.
Once we finish it, we will provide a new fix.

Thanks for your understanding!

Hello Aspose team,

We can use an alternate solution without function shiftRow. But can you help us fix the bug getDependents (<A href="https://forum.aspose.com/t/135457</A>) soon? The solution need the getDependents function. This function work perfect was enough for us.</P> <P>Thanks you!</P>


We will fix both the issues. Currently, their status is “in process”.

But for your need we try to fix your other issue first: <a href="https://forum.aspose.com/t/135457

If we have any update about any issue, we will notify you in the related thread.

Thank you.