Tuesday, 2 October 2012

Error : The project currently contains references to more than one version of Microsoft.Vbe.Interop

I get this error message when ever I oped a VB.Net project from all the Visual Studio versions.

This is because you have a different version of office installed in your PC. To get rid of this error and compile your project successfully please follow this.

You need to locate the correct version of office dll files and place them in the project bin folder and add these references to you project.

i.e. in my case

Microsoft.Office.Interop.Excel.dll           (11.0.0.0)
Office.dll         (11.0.0.0)

It was confused because my computer had the office 2010 installed (I checked this with other computers had different office version as well)

Best Luck
Siraj