Sub DisplayExcelVersions()
MsgBox "The version of Excel is " & Application.Version
MsgBox "The version of the VBE is " & Application.VBE.Version
End Sub
The use of the Application.Version property is useful for ensuring code only operates on a compatible version of Excel.