title: 0x800a03ec Exception when using Microsoft.Office.Interop.Excel.Workbook.Open()
body: <p>I created a AutoCAD plugin and distributed it across group of users. The issue is that I am facing is that it is working for some users while it is crashing on some computers. This problem may be with the computer or code, therefore please read through. </p>
  
  <pre><code>string strFullPath= "D:\Model\Motor-Manifest\Manifest.xlsm";
  Excel.Application excelapplication= new Excel.Application();
  Excel.Workbook XlWorkBook = excelapplication.Workbooks.Open(strFullPath, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, false);
  </code></pre>
  
  <p>The error that I got is as follows</p>
  
  <blockquote>
    <p>System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC</p>
    
    <p>at Microsoft.Office.Interop.Excel.Workbooks.Open(String Filename,
    Object UpdateLinks, Object ReadOnly, Object Format, Object Password,
    Object WriteResPassword, Object IgnoreReadOnlyRecommended, Object
    Origin, Object Delimiter, Object Editable, Object Notify, Object
    Converter, Object AddToMru, Object Local, Object CorruptLoad)</p>
  </blockquote>
  
  <p><strong>Things I tried and didn't work</strong></p>
  
  <ul>
  <li>Tried reinstalling same version of office (Office 365 Proplus V1902) on affected machines which was suugested in this <a href="https://stackoverflow.com/questions/46075307/c-sharp-system-runtime-interopservices-comexception-0x800a03ec-exception-from">article</a></li>
  <li>Make sure file is valid, not corrupted, writeable, not protected </li>
  <li>Regional format settings are same on all machines suggested here <a href="https://stackoverflow.com/questions/30078729/exception-hresult-0x800a03ec-when-trying-to-open-excel-with-microsoft-office-int">here</a></li>
  <li>Changed settings in "DCOM Config" for Excel application explained <a href="https://stackoverflow.com/questions/46075307/c-sharp-system-runtime-interopservices-comexception-0x800a03ec-exception-from">here</a></li>
  <li>Tried using <code>excelapplication.Workbooks.Open(strFullPath);</code></li>
  <li>Tried using Epplus but that resulted in corrupted file, please note that I cannot change this file in anyway this is the file that we get from someone else</li>
  <li>Tried using two different versions interop dll (14.0 &amp; 15.0)</li>
  <li>Tried using xlsx file</li>
  <li>Local language is set english US as advised <a href="https://forums.asp.net/t/1687025.aspx?%20Exception%20from%20HRESULT%200x800A03EC%20Unable%20to%20open%20excel%20file" rel="nofollow noreferrer">here</a> </li>
  </ul>
  
  <p><strong>Few Observations</strong></p>
  
  <ul>
  <li><p>This plugin was working on all computers before, so we tried system restore on affected machines but did not work</p></li>
  <li><p>When the excel file is opened manually on the "affected machines", it kicks out the macros from it but it was not kicked out by anti-virus <a href="https://answers.microsoft.com/en-us/msoffice/forum/all/the-visual-basic-for-applications-vba-macros-in/58b82e19-2bff-421d-9373-1594d158a3b2" rel="nofollow noreferrer">Link</a></p></li>
  </ul>
  
  <p>All computers are using AutoCAD 2018, VS 2017, Office 365 Proplus and Windows 10 (X64).</p>
  
  <p>What should I do here? Any help is greatly appreciated. Thank you very much.  </p>