Expand Minimize
This topic has not yet been rated - Rate this topic

WorkbookBase.CalculationVersion Property

Gets a number that indicates the version of Excel that the workbook was last fully recalculated by. The rightmost four digits are the minor calculation engine version number, and the other digits (on the left) are the major version of Microsoft Office Excel.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)
public int CalculationVersion { get; }

Property Value

Type: Int32
A number that indicates the version of Excel that the workbook was last fully recalculated by. The rightmost four digits are the minor calculation engine version number, and the other digits (on the left) are the major version of Microsoft Office Excel.

If the workbook was saved in an earlier version of Excel and if the workbook has not been fully recalculated, then this property returns 0.

The following code example uses the CalculationVersion property to display the version of Excel in which the workbook was last fully recalculated.

This example is for a document-level customization.

private void DisplayCalculationVersion()
{
    if (this.CalculationVersion == 0)
    {
        MessageBox.Show("This workbook has not been calculated.");
    }
    else
    {
        MessageBox.Show("This workbook was last calculated in version " +
            this.CalculationVersion);
    }
}
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.