title: Why Excel.Interop is returning a wrong HResult instead of FILE_NOT_FOUND?
body: <p>I have been trying to load an excel file using the following code -</p>
  <pre><code>_workbook = await Task.Run(() =&gt;
              {
                 return _excelApp.Workbooks.Open(fileName);
              }).ConfigureAwait(false);
  </code></pre>
  <p>If I provide a non-existent file name in the <code>fileName</code> parameter, it's throwing a generic COMException with the following error code - <code>0x800a03ec</code></p>
  <p>According to the Interop documentation, the .NET runtime should convert the HResult to a specific exception - <a href="https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.comexception?view=net-5.0" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.comexception?view=net-5.0</a></p>
  <p>For this specific case, I was expecting to get a <code>FileNotFoundException</code> instead of the generic <code>COMException</code>. But since the HResult is not <code>FILE_NOT_FOUND</code>, its throwing the generic <code>COMException</code>. My question is why the interop is returning a wrong HResult? Is there anything wrong I have done here or its a bug in Excel.Interop?</p>