SpreadsheetGear The Performance Spreadsheet Component Company 
MaxRecursions Property
See Also 
SpreadsheetGear Namespace > IWorkbookSet Interface : MaxRecursions Property
Gets or sets the maximum number of recursive calculations allowed when references to cells still needing calculation are detected during workbook set calculation.

Syntax

C# 
virtual int MaxRecursions {get; set;}

Remarks

Recursion is used when a reference to a cell still needing calculation is detected during workbook set calculation, up to the maximum number of recursions allowed by the MaxRecursions property. When the maximum number of recursions is exceeded, a slower strategy will be employed to calculate these cells.

The default number of recursions allowed is 1024. This is high enough that the vast majority of workbooks will be calculated using recursion, and low enough that stack overflow exceptions are extremely rare (this property was made public two years after SpreadsheetGear for .NET was released in response to the first reported case of a stack overflow exception).

Some workbooks will generate stack overflow exceptions in environments with limited stack size available (such as some ASP.NET implementations which are limited to a stack size of 256K). Setting MaxRecursions to a smaller number will limit the amount of stack space used.

Some complex workbooks will calculate faster with higher MaxRecursions settings.

In most cases, the setting of MaxRecursions will have little or no effect after a workbook set is calculated the first time.

Requirements

Platforms: Windows Vista, Windows XP, Windows Server 2008, Windows Server 2003, Windows 2000, Windows Me and Windows 98, including 32 bit and 64 bit editions where applicable. SpreadsheetGear for .NET 1.x requires the Microsoft .NET Framework 1.1 or .NET 2.0 (works with .NET 3.x). SpreadsheetGear for .NET 2007 requires the Microsoft .NET Framework 2.0 (works with .NET 3.x).

See Also