SpreadsheetGear 2023
GC Method (IWorkbookSet)


SpreadsheetGear Namespace > IWorkbookSet Interface : GC Method
Attempts to optimize the amount and layout of memory used by this workbook set.
Syntax
'Declaration
 
Sub GC() 
'Usage
 
Dim instance As IWorkbookSet
 
instance.GC()
void GC()
Remarks

In the normal course of creating and modifying workbooks, data structures are frequently allocated with more space than necessary to reduce the time spent growing them. GC attempts to reduce the size of these data structures, potentially saving a significant amount of memory.

Memory can also become fragmented. GC attempts to group related objects closer together which can improve performance of calculations for certain workbooks. As a general rule it is best to call GC once after at least one, and possibly multiple calls to IWorkbookSet.CalculateFull.

The best way to find the optimal use of IWorkbookSet.GC for your workbooks is by benchmarking your real world cases.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

IWorkbookSet Interface
IWorkbookSet Members
Calculate Method
CalculateFull Method
CalculateFullRebuild Method