| First Published 30 Aug 2026 | Last Updated 15 Sept 2026 |
|---|
The six new SysCmd actions released with version 2604 provide very useful information about the installed Office version.
For example SysCmd(acSysCmdGetFullVersion) or SysCmd(720) give the full version info:
The other five new SysCmd values, 721 through to 725, provide the individual components of that information.
These new commands are available in all Click to Run Consumer editions (NOT LTSC) of Access from 2016 onwards as well in Access 365.
For more information see my earlier article: Access SysCmd Actions (Documented & Undocumented)
The new commands make it much easier to obtain the full Access version, build and bitness information from clients when they report issues.
It also helps with troubleshooting when forum members report possible Access bugs.
Unfortunately, none of the SysCmd actions include information about the Office license for the current user.
This is an important omission as certain features are only included with certain Office licenses.
For example, the Edge browser control and VBA Project Signing are only available in Access 365 and 2024. The new Zooming feature is only available in Access 365 version 2605 onwards.
To try and make this clearer, I recently wrote an article summarising the Access editions, versions and channels containing all the major Access features added in recent years: Summary of New And Upcoming Features
In fact, all Office Click-to-Run (C2R) versions from 2016 through to 365 have the same core code and are all designated Office 16.0.
The main difference is that some features are enabled or disabled in the various licensed editions.
This can cause confusion about the availability of specific features where different users are running identical Office versions, builds and release channels but have licenses for different Office editions e.g. 365 or 2021.
To further complicate matters, some workstations may have more than one user, each with their own unique Office license.
Only one copy of Office needs to be installed, but each user will have a different feature set.
Of course, users can take a screenshot of the Product Information in File | Backstage view:
This DOES include the license information but omits the bitness (32-bit / 64-bit)
It was for all these reasons that when the new SysCmd actions were first released with version 2604, fellow Access MVP, Karl Donaubauer, and I both asked that the license info be added.
It is hoped that this will be done in a later update though there is no commitment to this being done as yet.
In the meantime, this article shows how the license information can be obtained easily from the registry using VBA code.
Getting License Information using VBA
The registry contains a huge amount of information about installed applications including Office. The main difficulty is finding the correct location for the information you need.
For example, information about the installed build and channel is available at: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration
However, that location is of no use for the license info as that applies to the current user and not the machine.
A quick search showed that the information we require is available at:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Common\Licensing\LastKnownC2RProductReleaseId
In the example below, the current user has a Pro Plus Office 365 license and some additional entries.
Apparently the 4 products ending in IM are used in telemetry for tracking feature usage, managing diagnostics etc.
Another user account on the same machine has Home Premium Retail licenses for all Office 365 apps including Access as well as 2021 Volume (LTSC) licenses for Project and Visio.
To obtain this information using VBA, we just need a function to read the relevant registry key value. The code below uses WScript.Shell to do this:
FunctionGetCurrentUserAccessLicense()As StringDimWSHShellAs ObjectSetWSHShell=CreateObject("WScript.Shell")GetCurrentUserAccessLicense=WSHShell.RegRead("HKEY_CURRENT_USER\"& _"SOFTWARE\Microsoft\Office\16.0\Common\Licensing\LastKnownC2RProductReleaseId\Access")SetWSHShell=NothingEnd Function
Example output:
Using this function in conjunction with SysCmd(720) will provide all the required information for bug reports etc.
You can replace the Office product name in the function to get the license info for other Office products e.g. Visio
FunctionGetCurrentUserVisioLicense()As StringDimWSHShellAs ObjectSetWSHShell=CreateObject("WScript.Shell")GetCurrentUserVisioLicense=WSHShell.RegRead("HKEY_CURRENT_USER\"& _"SOFTWARE\Microsoft\Office\16.0\Common\Licensing\LastKnownC2RProductReleaseId\Visio")SetWSHShell=NothingEnd Function
In this case, we get:
NOTE:
If the selected Office product is not installed, the above code will trigger error -2147024894 (&H80070002):
The following solution with error handling is more robust and was suggested by Axel Heyne:
Public EnumMicrosoftOfficeProductAccess= 1:Excel= 2:Lync= 3:OneNote= 4:Outlook= 5:PowerPoint= 6:Publisher= 7:Project= 8:Visio= 9:Word= 10End EnumPublic FunctionGetCurrentUserMicrosoftOfficeProductLicense(ByValxMicrosoftOfficeProductAsMicrosoftOfficeProduct)As StringConstPROCEDURE_NAMEAs String= "GetCurrentUserMicrosoftOfficeProductLicense()"On Error GoToErr_HandlerConstMICROSOFT_OFFICE_LICENSING_KEYAs String= _"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Common\Licensing\LastKnownC2RProductReleaseId"DimofficeProductNameAs StringofficeProductName= _Choose(xMicrosoftOfficeProduct, _"Access", "Excel", "Lync", "OneNote", "Outlook", "PowerPoint", "Publisher", "Project", "Visio", "Word")WithCreateObject("WScript.Shell")GetCurrentUserMicrosoftOfficeProductLicense= _.RegRead(MICROSOFT_OFFICE_LICENSING_KEY& "\"&officeProductName)End WithExit_Handler:Exit FunctionErr_Handler:ConstERR_UBABLE_TO_OPEN_REGISTRY_KEYAs Long= &H80070002IfErr.Number=ERR_UBABLE_TO_OPEN_REGISTRY_KEYThenGetCurrentUserMicrosoftOfficeProductLicense= _"Can't determine license of Microsoft Office product »"&officeProductName& "«"ElseMsgBox Err.Number& " : "&Err.Description,vbCritical,PROCEDURE_NAMEEnd IfResumeExit_HandlerEnd Function
Example Usage:
Using the Enum value (e.g. 1) or the full Enum description (e.g. MicrosoftOfficeProduct.Access) will ALWAYS work.
Alternatively, you can also use the product name . . . but with one exception. The product name cannot be used when it is also used as a library reference (as the library name has a higher priority than the Enum member).
| Code run from Access | Code run from Excel | |
|---|---|---|
|
|
If you have references to e.g. both Access & Excel, both usages will fail (but all others in the list will work). Hopefully that all makes sense!
Other Useful Information
Occasionally, Office bugs are language specific. For that reason, it can also be useful to get the current Office language info using code.
VBA code to obtain the Office and Windows language info is available in a separate article: Get Office/Windows Language Info Using Code<
Feedback
Please use the Email button in the contact form below to let me know whether you found this article useful or if you have any questions.
Please also consider making a donation towards the costs of maintaining this website. Thank you
| Colin Riddington | Mendip Data Systems | Last Updated 15 Sept 2026 |
|---|
|
Return to Code Samples Page
|
Return to Top
|