Formulas are excellent spreadsheet helpers that can summarize expenditures and profits, provide the mean or medium of a set of data, or provide more advanced computations such as compound interest or depreciation. The 2007 Volume 2 release gives you the advantage of adding formulas to your Microsoft® Excel® worksheets built with our Excel object model.
A successful formula requires two main ingredients:
the cell or range of cells used to compute the formula
a cell or group of cells in which to place the result
The Parse and TryParse methods off the Formula object handle the first ingredient – pass in the formula and cell reference mode to this method. The formula will include the cell or range of cells that are used to compute the formula. The ApplyTo method, also found off the Formula object, handles the second ingredient. It passes in the cell or cell regions you want the result of the formula to be placed in.
Formulas can be as simple or complex as needed. That’s why we included a TryParse method, so you can confirm that the formula was parsed correctly before using it. You can parse any standard Excel formula (refer to your Excel documentation for more information on supported formulas).