title: Excel Interlop Error on New Server after migration
body: <p>I recently migrated a windows service to a new server for my company. This service reads data from a sql table and builds an excel document from it, using a template. Unfortunately, even with all of the same code, I am getting a new error when I try to execute the service.</p>
  
  <pre><code>Exception from HRESULT: 0x800A03EC 
  Stack Trace: 
  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)
  </code></pre>
  
  <p>This is the code which executes leading up to the error:</p>
  
  <pre><code>        Dim xlApp As Excel.Application
          Dim xlWorkBook As Excel.Workbook
          Dim xlWorkSheet As Excel.Worksheet
  
          xlApp = New Excel.ApplicationClass
          xlWorkBook = xlApp.Workbooks.Open(System.AppDomain.CurrentDomain.BaseDirectory() &amp; strTemplatePath)
  </code></pre>
  
  <p>The old server is running Microsoft Windows Server 2003 SP2 and the new server is running Microsoft Windows Server 2012 Datacenter. Both have Excel 2003 installed.</p>
  
  <p><strong>What I've tried:</strong></p>
  
  <p>Prayer</p>
  
  <p>Providing permissions to the user which executes the app</p>
  
  <p>Setting my CurrentCulture to "en-US"</p>
  
  <p>Moving the template file to c:\Templates in case of a weird issue with the program files directory</p>
  
  <p>Matching the two server's settings for the "Microsoft Excel Application" within dcomcnfg and mmc-32 (neither is set to "interactive user")</p>
  
  <p>Replacing the currently utilized Excel Interlop file (11.0.8161.0) with the newest version I could find (15.0.4795.1000)</p>
  
  <p>Any help would be appreciated. Thanks</p>
  
  <p>In response to comments:</p>
  
  <p>Inspecting BaseDirectory and strTemplatePath yield a valid path to my excel workbook. If I paste it directly into the explorer address bar the file opens.</p>