Objective Grid: Updating formula cells that reference cells changed programmatically

Article ID: 325
Last updated: 11 Jun, 2018
Article ID: 325
Last updated: 11 Jun, 2018
Revision: 3
Views: 1934
Posted: 24 Jan, 2001
by Meltreger B.
Updated: 11 Jun, 2018
by Meltreger B.

Problem


How do I update formula cells that have a reference to a cell which has been changed with SetValueRange()?


Cause



Action


If you programmatically change cells with SetValueRange() you have to call RefreshViews() to force recalculation of depending formula cells. RefreshViews() will determine those cells that are depending on previously modified cells and update them in the grid window if their value has changed.

If you prefer not to update the grid window you can call Recalc(). Recalc() also determine those cells that are depending on previously modified cells and mark them to be recalculated the next time you call GetValueRowCol(). However, you have to completely redraw the whole grid later to be sure that display contents are in sync with the actual values.

If you do call neither RefreshViews() nor Recalc() formula cells will not be recalculated. The reason why SetValueRange() does not recalculate depending cells is because often there will be subsequent changes to neighboring cells. It is much faster to do recalculate cells all at once instead of recalculating cells with each SetValueRange() call.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 325
Last updated: 11 Jun, 2018
Revision: 3
Views: 1934
Posted: 24 Jan, 2001 by Meltreger B.
Updated: 11 Jun, 2018 by Meltreger B.

Others in this category