Unplanned
Last Updated: 04 Nov 2022 10:05 by Matthew
Matthew
Created on: 04 Nov 2022 10:05
Category: SpreadProcessing
Type: Bug Report
1
SpreadProcessing: Indirect function is not correctly evaluated when a value is changed after import.

When a worksheet has a function of the type "=Indirect("A1")" and the value in A1 is edited, the result of the function is not updated. This, however, happens only after the file is imported. If the function is created through code or SetValueAsFormula is called after import, the function works as expected.

Workaround:

            CellRange usedCellRange = worksheet.UsedCellRange;

            for (int row = 0; row < usedCellRange.RowCount; row++)
            {
                for (int column = 0; column < usedCellRange.ColumnCount; column++)
                {
                    ICellValue cellValue = worksheet.Cells[row, column].GetValue().Value;
                    if (cellValue.ValueType == CellValueType.Formula)
                    {
                        worksheet.Cells[row, column].SetValue(cellValue);
                    }
                }
            }
0 comments