Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
For my c# project I added Microsoft Excel 14 library from com component in office 2010 installed computer. After that I built the same project on office 2003 installed computer. I copied "Microsoft.Office.Interop.Excel.dll" from office 2010 installed coputer and add as the reference from office 2003 installed computer. But then I'm getting 2 errors when build

1.

Error 145 Assembly 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' uses 'Microsoft.Vbe.Interop, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' which has a higher version than referenced assembly 'Microsoft.Vbe.Interop, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' d:\References\Microsoft.Office.Interop.Excel.dll UI

2.

Error 146 Assembly 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' uses 'office, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' which has a higher version than referenced assembly 'office, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' d:\References\Microsoft.Office.Interop.Excel.dll
Posted

Looks like you referenced the '03 dll, but copied over the '10 dll. That's what the error is saying. I guess, just don't do that?
 
Share this answer
 
v2
You are not going to be able to run or compile into a machine that does not have Office 2010 installed.

That is because Interop.Excel get into the GAC when Office is installed.

1) Re-Install Office 2010 & select 'Add or Remove features'

2) Under 'Microsoft Excel', make sure you turn on the '.NET Programmability Support' feature.

This will install the Microsoft.Office.Interop.Excel Version 14.0.0.0 in the GAC on the Target machine.
 
Share this answer
 
Comments
Richard Deeming 4-Mar-15 14:01pm    
This question is THREE YEARS OLD, and already has an accepted answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900