title: Check installed Excel version and launch it
body: <p>I am trying in my application to launch Microsoft Excel with specific arguments (ie. additional xla &amp; xll).</p>
  
  <p>For now it works fine because all of my users only have Office11 (=2003) installed.</p>
  
  <p>My company is going to switch to Windows 7 &amp; Office 2010 and I logically can't launch any excel since the .exe is not located in <code>C:\Program Files:\Microsoft Office\Office11\EXCEL.EXE</code></p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Using my current machine (Win XP x86, Office11), I can find it in <code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Excel\InstallRoot</code></p>
  
  <p>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.</p>
  
  <p>Do you guys know any way to launch the currently installed excel from C#?</p>
  
  <p>FYI, here is the current code section, launching Office11 from a x64 / x86 machine:</p>
  
  <pre><code>    private void LaunchExcel(string arguments)
      {
          if (!Is64BitsOS())
          {
              Process process = new Process();
              process.StartInfo.FileName = "excel";
              process.StartInfo.Arguments = arguments;
              process.Start();
          }
          else
          {
              Process process = new Process();
              process.StartInfo.FileName = "c:/Program Files (x86)/Microsoft Office/Office11/excel.exe";
              process.StartInfo.UseShellExecute = false;
  
              process.StartInfo.Arguments = arguments;
              process.Start();
          }
      }
  </code></pre>
  
  <p>Any ideas to make this code more generic?</p>