I am using RowFunctions.Sum like this
table.Columns[columnIndex].TotalsRowFunction = RowFunctions.Sum;
But this is showing a formula with #Ref!
e.g. =SUBTOTAL(109,#REF!) but it should be like =SUBTOTAL(109,[Line No.]).
If I add the formula like this
var colName = table.Columns[columnIndex].Name;
table.Columns[columnIndex].TotalsRowFormula = $"SUBTOTAL(109,[{colName}])";
Then it's working fine, but still showing this warning in Excel.
Not sure what is happening, but it was working in 4.x and not working in 7.x version

Could you help me with this?