Microsoft Office Interop Excel Dll Version 12.0.0.0

  

Active3 years, 7 months ago

I have web-site that uses MS Excel files read/write.

I added related dll's to Bin folder of the site, and it works perfect on my local host (I think bacause I have installed MS Excel 2010 on my pc)

The Microsoft Office 2010 Primary Interop Assemblies (PIA) Redistributable is a Microsoft Windows Installer package that contains the Primary Interop Assemblies for Microsoft Office 2010 products. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. I have added reference of 'Microsoft.Office.Interop.Excel' dll in webApplication. In local its working fine. What is Microsoft.Office.Interop.Excel.dll? Microsoft.Office.Interop.Excel.dll is part of 2007 Microsoft Office system and developed by Microsoft Corporation according to the Microsoft.Office.Interop.Excel.dll version information. Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. I got solution by changing Excel.dll version. I was using 15.0.0.0 and now I changed it to 12.0.0.0 and its working fine. I got dll from Add reference > Browse > C: > Windows > assembly > GAC > Microsoft.Office.Interop.Excel > 12.0.0.0_etc > Microsoft.Office.Interop.Excel.dll. 'Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=10.0.4504.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.' I copied the files & registered to all locations i have on my local PC.

But when I uploaded it to remote pc and run the site, it throws an error:

Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

files in Bin folder are:

一 加载文件或程序集“Microsoft.Office.Interop.Excel。。。 Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. 出现这个问题的原因有两个: 1、系统里没有安装“Excel 2003.

I've installed on remote pc 'Microsoft Office 2010: Primary Interop Assemblies Redistributable',http://www.microsoft.com/en-us/download/details.aspx?id=3508

But same error ocurrs.

How to resolve this issue?

Thanks.

ihorkoihorko
3,74822 gold badges64 silver badges101 bronze badges

4 Answers

ihorkoihorko

Microsoft Office Interop Excel Example Visual Basic

3,74822 gold badges64 silver badges101 bronze badges

I know that this thread is a little bit old but I had the same error and I solved it (it works in my project).

In my web.config file I had assemblies added:

<add assembly='office, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'/> and many other office assemblies.

The thing I have done is that I have removed all the assemblies from web.config file and had added dlls as a reference - Microsoft.Office.Interop.Excel.dll in this case.

I am not an expert and I just thinking loudly that web.config file is trying to pull dll. file from C:Windowsassembly and if there if it could not be foud, returns error.

You don't have to install office or other unneccessary stuff on you server.

Hope this help someone.

ironcurtainironcurtain

you no need to install MS Office- 2010, Add Reference -> COM-> 'Microsoft office 12.0 Object Libaray'

its works for me.

Rajesh DRajesh D

Correct procedure to use Excel in C# Projects is:

  1. Add reference to Excel Interop Library(Assembly)
  2. Add Excel in using section
  3. Now use it in your coding.

Microsoft.office.interop.excel.dll

The first step will work if you have Office(Excel) Installed in your PC. If not then install. Then add reference to Microsoft.Office.Interop.Excel of the version you need.

Microsoft Office Interop Excel Dll Version 12.0.0.0

a. If list doesn't shows the desire version then you may have another vision of Office with Excel installed. By The Way, you can use any.

b. If you don't find anything like Microsoft.Office.Interop THEN may be office not installed OR you have Office 2013 or later. For higher version you can add assembly by going into COM tab of add-reference windows and add Microsoft Excel {version-no} Object Library. This will add the same.

c. If you already have Microsoft.Office.Interop... in References with yellow-triangle-mark THEN remove it first.

After that second step will totally work: using Excel=Microsoft.Office.Interop.Excel;

And finally as a third step you can create Excel object by Excel.Application xlApp = new Excel.Application();.

DllMicrosoft office interop excel location

Microsoft Office Interop Excel Location

Adarsh RajputAdarsh Rajput

Not the answer you're looking for? Browse other questions tagged asp.netexceliisdll or ask your own question.