I've just upgraded to the latest version of XlsIO and now my previously working code is failing.
// Update formulas:
var columnsWithFormula = new[] { "H", "I", "K", "M", "R", "S", "T", "U", "V", "W" };
foreach (var columnWithFormula in columnsWithFormula)
{
if (!worksheet.Range[$"{columnWithFormula}{startRow}"].HasFormula) continue;
worksheet.Range[$"{columnWithFormula}{startRow}:{columnWithFormula}{row}"].Formula = worksheet.Range[$"{columnWithFormula}{startRow}"].Formula;
}
I open an existing Workbook which has formulas in startRow. After filling records I want to copy the formula in the startRow to the new rows.
row is in this case 432.
This used to work, but now I get this exception:
System.ArgumentOutOfRangeException:
Parameternaam: index
bij Syncfusion.XlsIO.Parser.Biff_Records.Formula.RefNPtg.CodeToIndex(FormulaToken token)
bij Syncfusion.XlsIO.Parser.Biff_Records.Formula.RefNPtg.ConvertSharedToken(IWorkbook parent, Int32 iRow, Int32 iColumn)
bij Syncfusion.XlsIO.Implementation.FormulaUtil.ConvertSharedFormulaTokens(SharedFormulaRecord shared, IWorkbook book, Int32 iRow, Int32 iColumn)
bij Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.SetSharedFormula(WorksheetImpl sheet, String strFormulaString, String strCellsRange, UInt32 uiSharedGroupIndex, Int32 iRow, Int32 iCol, Int32 iXFIndex, Boolean bCalculateOnOpen)
bij Syncfusion.XlsIO.Implementation.RangeImpl.set_Value(String value)
bij Syncfusion.XlsIO.Implementation.RangeImpl.set_Formula(String value)
Did something change in the new version?
How to update my code to get it working again?