Overview
Knowing the installed Microsoft Office versions, particularly Excel versions, is crucial for various applications. This guide provides a reliable method for detecting these versions.
Methodology:
A dependable approach involves examining the InstallRoot Registry keys.
Registry Key Locations:
Each Office application maintains a unique registry key indicating the executable's location:
HKLM\Software\Microsoft\Office\Version\Word\InstallRoot::Path
HKLM\Software\Microsoft\Office\Version\Excel\InstallRoot::Path
HKLM\Software\Microsoft\Office\Version\PowerPoint\InstallRoot::Path
Version Number Mapping:
Substitute "Version" with the corresponding version number:
Microsoft Office Version | Registry Version Number |
---|---|
97 | 7.0 |
98 | 8.0 |
2000 | 9.0 |
XP | 10.0 |
2003 | 11.0 |
2007 | 12.0 |
2010 | 14.0 |
2013 | 15.0 |
2016 | 16.0 |
2019 | 16.0 |
Special Considerations for Office 2019 and Office 365:
The Click-To-Run installation method used by Office 2019 and subsequent versions alters the registry structure. Version numbers are not consistently present in registry keys. While the file version of winword.exe
might offer a clue, this can be unreliable as it also increments with patches applied to older Office 2016 installations.
Summary:
By inspecting the InstallRoot Registry keys and using the appropriate version numbers, you can effectively determine installed Microsoft Office versions, including specific Excel installations. However, be aware of the limitations when dealing with Click-To-Run installations of Office 2019 and Office 365.
The above is the detailed content of How Can I Programmatically Detect Installed Microsoft Office Versions?. For more information, please follow other related articles on the PHP Chinese website!