Hi,
I am moving my C# project from the Interop to Spire.
Below piece of code is working in Interop, but not in Spire:-
Interop:-
When I provide the formula "=SUM(F2,G2)" across the range, it automatically gets appied to the range of cells for example:-
"=SUM(F3,G3)" for 3rd row
"=SUM(F4,G4)" for 4th row and so on:-
Below is the piece of code
----------------------------------------------------------------------------
string formula = string.Format("=SUM(F" + "{0}" + ",G" + "{0}" + ")", 2);
//sheet.Range[
Excel.Range to = xlWorkSheet.Range[xlWorkSheet.Cells[2, cl + 1], xlWorkSheet.Cells[rw, cl + 1]];
to.Formula = formula;
-------------------------------------------------------------------------------------------
Spire:-
But when I apply the same code, it hard codes the formula to the "=SUM(F2,G2)" across the range:-
"=SUM(F2,G2)" for 3rd row
"=SUM(F42,G2)" for 4th row and so on:-
Below is the piece of code
---------------------------------------------------------------------------------------------
string formula = string.Format("=SUM(F" + "{0}" + ",G" + "{0}" + ")", 2);
CellRange to = xlWorkSheet.Range[2, cl + 1, rw, cl + 1];
to.Formula = Formula;
----------------------------------------------------------------------------
I do not want to iterate through the range and put the formula individually in the cell, due to performance issues.
Any help is much appreciated, do let me know for any updates
Thanks and Regards,
Rakesh Chaturvedi