1

I am opening an excel file using

 object missing = Type.Missing;

xlWorkBook = xlApp.Workbooks.Open(strFilePath, missing, false, missing, missing, missing,
true, missing, missing, missing, missing, true, missing, missing, missing);

and it throws HRESULT: 0x800A03EC

It was working fine with office 2010 but after updating office libraries to version 15 and when deployed to server which had office 2013. I started getting this message. I have also tried giving permission to Excel Object in DomConfig but it didn't worked,,

Naveen Kumar Alone
  • 7,536
  • 5
  • 36
  • 57
AddyProg
  • 2,960
  • 13
  • 59
  • 110
  • @adil-waqal: What version of server are you using? This [answer](http://stackoverflow.com/a/4448781/848737) could help you. – Charlie Jun 06 '15 at 16:12

2 Answers2

0

note that there are many versions of Microsoft.Office.Interop.Excel.dll
for me, I can find one in:

C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14


and another one in:

C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office12


remove references from your project and add the suitable ones, rebuild your solution.
EDIT #1
Office11 is the internal name for Office 2003.
Office12 that for Office 2007.
Office14 that for Office 2010.
When Installing Microsoft Office, make sure that the .NET Programmability Support feature is selected. Also, you can download them form :
Office 2010: Primary Interop Assemblies
try to find those for Office 2013 .

houssam
  • 1,823
  • 15
  • 27
0

It doesn't matter what version of Office PIAs you are using at the moment because even with old PIAs your code should work against the newest Office versions.

Instead, take a look a look at the Considerations for server-side Automation of Office article which states the following:

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45