Home » excel » c# – Check installed Excel version and launch it

c# – Check installed Excel version and launch it

Posted by: admin May 14, 2020 Leave a comment


I am trying in my application to launch Microsoft Excel with specific arguments (ie. additional xla & xll).

For now it works fine because all of my users only have Office11 (=2003) installed.

My company is going to switch to Windows 7 & Office 2010 and I logically can’t launch any excel since the .exe is not located in C:\Program Files:\Microsoft Office\Office11\EXCEL.EXE

I ran a quick check in the registry to see that I can definitely check what version is currently installed. There are also plenty of articles explaining how to get the currently installed Office version.

However, I’d like to know if it is possible to find anything (such as a good registry key) directly giving me the .exe path so as to launch Excel.

Using my current machine (Win XP x86, Office11), I can find it in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Excel\InstallRoot

Using this key I can, basically, find a workaround to get the actual path. Problem: there is no such key in Windows 7’s registry with Office 2010 (= Office 14) installed.

Do you guys know any way to launch the currently installed excel from C#?

FYI, here is the current code section, launching Office11 from a x64 / x86 machine:

    private void LaunchExcel(string arguments)
        if (!Is64BitsOS())
            Process process = new Process();
            process.StartInfo.FileName = "excel";
            process.StartInfo.Arguments = arguments;
            Process process = new Process();
            process.StartInfo.FileName = "c:/Program Files (x86)/Microsoft Office/Office11/excel.exe";
            process.StartInfo.UseShellExecute = false;

            process.StartInfo.Arguments = arguments;

Any ideas to make this code more generic?

How to&Answers:

The 32 bit version of Excel 2010 running on a 64 bit version of Windows (XPx64,Vistax64,Win7x64) will have the following key.
I think this is the key you are looking for

The 64 bit version of Excel 2010 running on a 64 bit version of Windows (XPx64,Vistax64,Win7x64) will have the following key


copied from here


If you start Excel to open an Excel file, you can start a Process with the Excel file as FileName and let the Windows shell do all the work to find the associated application. You’d need an exception handler, obviously.

This would make you independent of Office and Windows versions and registry keys.

Otherwise you could take a different approach and find the associated application, like here.

The point of these suggestions is: presently, you have to change your code as soon as a new Office version is installed or a different Windows version is used, while there is a way to avoid these dependencies.