1

I am desperately trying to find some VBA code to give me the current Office 365 version and build number, which I will be using further down the line.

I have written the following:

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

But this only returns:

Version 16.012325

What I am looking for is a way to retrieve the version and full build number (The version number and build number displayed in the File, Account section:

Version 1912 Build 12325.20288

Appreciate the help!

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
Gray Meiring
  • 297
  • 2
  • 3
  • 16
  • 1
    Unfortunately, there's currently no way of doing so. See this answer for more: https://stackoverflow.com/a/3267832/2119523 – Netloh Jan 22 '20 at 12:37

1 Answers1

0

Only a partial answer for the build number, not the version (sorry, I don't have enough reputation to just add a comment) - you can get the build number like this:

MsgBox CreateObject("Scripting.FileSystemObject"). _
        GetFileVersion(Application.Path & "\EXCEL.EXE")

Returns "16.0.14326.20404" on my device. Obviously this is for Excel, use WINWORD.EXE for Word, POWERPNT.EXE for PowerPoint etc

To get just the "14326.20404" elements (if you trust Microsoft to always keep to the same 4-part build number!)

Dim elements() As String
elements = Split(CreateObject("Scripting.FileSystemObject"). _
        GetFileVersion(Application.Path & "\EXCEL.EXE"), ".")
MsgBox elements(2) & "." & elements(3)
JohnM
  • 2,422
  • 2
  • 8
  • 20