XLL+ Class Library

Calculation settings

The following settings affect the behaviour of an add-in function, and are passed to Excel within te function registration string.

Volatile

If you want a function to be recalculated whenever the sheet containing it is recalculated, then it should be marked as volatile, using the Volatile check-box in the XLL+ Function Wizard.

A function marked as Volatile will have an exclamation mark ('!') appended to its registration string.

Volatile functions are recalculated whenever calculation takes place, instead of only when an input cell changes. This means that they can be used to take account of implicit inputs to the function, i.e. data which affects the result, but is not passed to the function as an input.

Marking functions as volatile is a standard solution to dealing the impact of external data, but potentially it can be very expensive. Even if the value you return from a volatile function is unchanged, Excel will assume that it has changed, and will recalculate all cells which depend on the volatile cell. If those dependent cells contain slow expensive calculations, you can find yourself doing a long recalculation every time any cell is changed.

For an example of a volatile function, see Volatile functions in the User Guide.

See also Multi-threaded addins for more sophisticated ways of dealing with he impact of external data.

Defer recalculation

If you want to make use of SDK features not normally permitted to Type 1 functions, you can mark a function using the Defer recalculation check-box in the XLL+ Function Wizard. This will allow the function to inspect the values and formulae of other cells, even if they are not inputs to the function.

A function marked as Defer Recalculation will have a hash character ('#') appended to its registration string.

See Also

Function Wizard