Free Support Forum -

Array formula becomes standard formula after deleting row in .NET

After I delete a row, my array formulas become "standard" formula.

I attached the files after I deleted some rows.

I use the version

I also have a problem with the AutoFitColumn, it throws a NullReferenceException on many rows. I didn't have this problem when I used the version

Thank you


For formula issue, I have found the problem and will fix it soon.

For AutoFitColumn problem, I don't find it. Could you please post your sample code here?

Following is my code:

Workbook workbook = new Workbook();

int count = workbook.Worksheets[0].Cells.MaxDataColumn;
for(int i = 0; i < count; i ++)

Sorry it's my mistake.

I have the error with the AutoFitRow, not with AutoFitColumn.

Thank you.

Please try this attached fix.

Thank you, it fixed the 2 problems.

I have an other question.

I use absolute formula and also some mixed (absolute and reference) formula. When I copy those cells, the formula is not the same in the destination cell than the source cell like there was no $ in the formula. What can I do to fix that? If I was using only absolute formula I could get the formula of the source cell and set it to the destination cell but I also use mixed formula like this one


the $D8 should change when I copy the formula on another row but the rest should not change.

I use it with arrayformula, but I tested it with normal formula and I have the same problem.

thank you


Please post your output file with this new fix to show this problem. I tried in my machine with your old files but don’t find this problem.

I have done a little sample

Aspose.Cells.Workbook w = new Aspose.Cells.Workbook();

Aspose.Cells.Worksheet xlSheet = w.Worksheets[0];


xlSheet.Cells[1,1].Formula = "=$A$1";



When I open Excel, the formula in the cell E5 is =$D$4 but it should be = $A$1... at least it's what I thought it would be.

I attached the file with the fix, you will get some circual reference,...

In the old version I was only setting the formula, not copying the cell so I didn't have this problem before.

Thank you

Please try this attached version.

It fixed the problem with the formula, but when I copy a cell with an array formula, in the destination cell, it appears like a standard formula.

Thank you

Please try this fix.

Sorry for the delay, I was out of the office.

The problem with the copy of the absolute formula is back (formula array... I didn't check for a normal formula), it copy like there was no "$" in the formula. But the formula in the destination cell appears like an array formula like it should be.

Thank you

How do you copy the formulas? I used the following test code and it works fine:

Workbook workbook = new Workbook();

Cells cells = workbook.Worksheets[0].Cells;


Attached is my template file.

I copy the formula the same way you do.

It works with your code but I found the problem happens only when I copy the cell on a different row.

I used this line to copy the cell


Thank you.

Please try this attached version.

The problem is fixed. Thank you very much.