Software

Use VBA to return the current version number of any Office application

If you're running more than one version of Microsoft Office, you need this simple VBA procedure.

Many of us use or support more than one version of Office. With more than one version running, knowing the version of the currently running application can be critical. Not everything works the same way from version to version.

Fortunately, VBA makes the task of discerning the version of the currently running software a simple task. The following subprocedure returns the version number in a message box:

Sub GetVersion()
  MsgBox "The current version is " & Application.Version, _
    vbOKOnly, "Version"
End Sub

You can just as easily return the version number by using a function in the form

Function GetVersion() As Long
  GetVersion = Application.Version
End Function

(If you add both procedures to the same module, rename one of them.)

About

Susan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.

Editor's Picks