4

I am working on a console app which perform some operation on registry. I am not using any interop assembly for office but i need to to know office version. How to determine which version of MS office is installed on the machine using C#.

Kapil
  • 9,469
  • 10
  • 40
  • 53

2 Answers2

13

Search in (using the Registry class)

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths

or

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths

Version numbers are

  • 7.0 -97
  • 8.0 - 98
  • 9.0 -2000
  • 10.0 -2002
  • 11.0 -2003
  • 12.0 -2007
  • 14.0 -2010

Here is a c# implementation

Denys Wessels
  • 16,829
  • 14
  • 80
  • 120
Johnno Nolan
  • 29,228
  • 19
  • 111
  • 160
  • Not sure whether or not the above registry key is always reliable and safe, as I couldn't verify if it's officially supported. The better choice is the one mentioned [here](http://stackoverflow.com/questions/3266675/how-to-detect-installed-version-of-ms-office/3267832#3267832) which uses an [official registry key](http://office.microsoft.com/en-us/orkXP/HA011364611033.aspx). – Masood Khaari Oct 30 '13 at 07:04
  • It doesn't always work. I have a machine with Office 2013 installed and the registry entries are not found in the given path. – Teja Dec 03 '15 at 03:57
  • 1
    Try HKEY_CLASSES_ROOT\Excel.Application\CurVer as well as described in https://social.msdn.microsoft.com/Forums/vstudio/en-US/54a0862a-f0e9-4f2f-b988-782c602a274c/have-c-check-what-version-of-excel-is-installed?forum=csharpgeneral – Rishabh Jain Jun 05 '18 at 07:26
1

I had the same requirement, but I also have to find out whether office installed is 32-bit or 64-bit. I have documented my solution here:

http://cyrilbeschi.blogspot.com/2014/03/how-to-find-microsoft-office-version.html

Cyril Beschi
  • 5,194
  • 1
  • 15
  • 5