More than ever, with MS365 (previously Office 365), it is very important to easily be able to determine the release type (Volume License, Retail, Trial, …) of the Office installation as the different Release Types have different update schedules. Furthermore, what I have come to understand is that many users have no clue about Release Type nor how they can ascertain theirs.
This is the type of information along with things like the Bitness or Build No that anyone providing end-user support needs.
Today, I thought I’d offer a simple VBA function that can easily get this for us!
The VBA Solution
Most developers are not aware that each Office application has an Product Code GUID and that GUID follows a very specific format. If you know the format, then you can actually determine many different properties of that application, things like:
- Release Build
- Release Type
- Bitness
- …
Knowing this and after reviewing the various support webpages on the subject, we can then simply build a simple function to parse the right element of the Product Code and return a plain English value.
'---------------------------------------------------------------------------------------
' Procedure : GetProductReleaseType
' Author : Daniel Pineault, CARDA Consultants Inc.
' Website : http://www.cardaconsultants.com
' Purpose : Determine the Release Type of the current application
' Tested in Access, Excel, Outlook, Word
' Copyright : The following is release as Attribution-ShareAlike 4.0 International
' (CC BY-SA 4.0) - https://creativecommons.org/licenses/by-sa/4.0/
' Req'd Refs: None required
' References:
' 2013 - https://docs.microsoft.com/en-US/office/troubleshoot/office-suite-issues/numbering-scheme-product-code-guids
' 2016 - https://docs.microsoft.com/en-us/office/troubleshoot/office-suite-issues/numbering-scheme-for-product-guid
'
' Usage:
' ~~~~~~
' ? GetProductReleaseType
' Returns -> Retail/OEM
'
' Revision History:
' Rev Date(yyyy-mm-dd) Description
' **************************************************************************************
' 1 2021-10-28 Public Initial Release
'---------------------------------------------------------------------------------------
Function GetProductReleaseType() As String
On Error GoTo Error_Handler
'{BRMMmmmm-PPPP-LLLL-p000-D000000FF1CE}
'R Release type 0-9, A-F
Select Case Mid(Application.ProductCode, 3, 1)
Case "0"
GetProductReleaseType = "Volume license"
Case "1"
GetProductReleaseType = "Retail/OEM"
Case "2"
GetProductReleaseType = "Trial"
Case "5"
GetProductReleaseType = "Download"
Case Else
GetProductReleaseType = "Unknown Release Type"
End Select
Error_Handler_Exit:
On Error Resume Next
Exit Function
Error_Handler:
MsgBox "The following error has occured" & vbCrLf & vbCrLf & _
"Error Number: " & Err.Number & vbCrLf & _
"Error Source: GetProductReleaseType" & vbCrLf & _
"Error Description: " & Err.Description & _
Switch(Erl = 0, "", Erl <> 0, vbCrLf & "Line No: " & Erl) _
, vbOKOnly + vbCritical, "An Error has Occured!"
Resume Error_Handler_Exit
End Function
and then, as mentioned in the header, you can use this function by doing something like:
Dim sReleaseType as String
sReleaseType = GetProductReleaseType
or
MsgBox GetProductReleaseType, vbInformation or vbOKOnly, "Release Type"
So now you can easily determine what type of product you are support so you can properly determine what build is available, if it is actually up-to-date or not, …
GetProductReleaaseType()
Interesting spelling of Release 😉
Thank you David. At least one of us is on the ball today! 🙂 I’ve corrected the typo.