Spread Windows Forms 7.0 Product Documentation
LoadFormulas Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > FpSpread Class : LoadFormulas Method

Whether to recalculate all the formulas in cells on the sheet that have changed

Glossary Item Box

Loads formulas that are deserialized but not parsed yet, to be used after all sheets have been created and deserialized.


Visual Basic (Declaration) 
Public Sub LoadFormulas( _
   ByVal recalculate As Boolean _
Visual Basic (Usage)Copy Code
Dim instance As FpSpread
Dim recalculate As Boolean
public void LoadFormulas( 
   bool recalculate


Whether to recalculate all the formulas in cells on the sheet that have changed


With the implementation of cross-sheet references in Spread, formulas can contain references to other sheets. If such formulas are loaded from a file, the Spread component must load sheets and formulas in a specific sequence for the cross-sheet references to work. The parsing of formulas loaded from a file must be delayed until all the sheets in the workbook have been loaded. The FpSpread.Open methods handle this automatically, loading the XML and parsing in the correct order.

If you have created custom deserialization code and your code loads individual sheets and adds them to a workbook, then you will need to add code to parse the formulas after the sheet has been added to the workbook. This can be done with this method. This method is implemented in the DefaultSheetDataModel and SheetView classes as well as the FpSpread class. Using the SheetView.LoadFormulas method or DefaultSheetDataModel.LoadFormulas method at the sheet level calls the method on all the data models for a particular sheet; using the LoadFormulas method at the FpSpread level calls the method on all the sheets.

The code in the example below should be called after the code that loads the sheet and adds it to the workbook.


This example loads the formulas.
C#Copy Code
fpSpread1.Sheets.Add(FarPoint.Win.Serializer.LoadObject(typeof(FarPoint.Win.Spread.SheetView), "C:\\SavedSheet.xml", "RootNode"));

Visual BasicCopy Code
FpSpread1.Sheets.Add(FarPoint.Win.Serializer.LoadObject(GetType(FarPoint.Win.Spread.SheetView), "C:\SavedSheet.xml", "RootNode"))


Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.