Share via


Workbook.CalculationVersion Property (2007 System)

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.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
Public ReadOnly Property CalculationVersion As Integer
'Usage
Dim instance As Workbook 
Dim value As Integer 

value = instance.CalculationVersion
public int CalculationVersion { get; }
public:
property int CalculationVersion {
    int get ();
}
public function get CalculationVersion () : int

Property Value

Type: System.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.

Remarks

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.

Examples

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 Sub DisplayCalculationVersion()
    If Me.CalculationVersion = 0 Then
        MsgBox("This workbook has not been calculated.")
    Else
        MsgBox("This workbook was last calculated in version " & _
            Me.CalculationVersion)
    End If 
End Sub
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);
    }
}

.NET Framework Security

See Also

Reference

Workbook Class

Workbook Members

Microsoft.Office.Tools.Excel Namespace