views:

34

answers:

1

I am using Excel Interop in my VB.net application. I am using Microsoft Office 11.0 Object Library and Microsoft.Office.Interop.Excel for excel automation. Both the dlls are for Office 2003. My question is, how can I get my project to refer to the latest version of MS Office( say Office 2010)

+1  A: 

I'm not sure if I'm understanding your question. If you have Office 2010 installed, you can just reference the v14 of the libraries.

However, if you mean that you don't have Office 2010 but you want to make your app work anyway, and especially if you want your app to work with multiple versions of Office, you want to look at late binding. This article describes the difference between early and late binding:
http://support.microsoft.com/kb/302902

One of the annoyances about late binding can be that you don't have the Intellisense and since I'm not an expert in Office automation it can slow me down quite a bit. I've sometimes gotten around this by creating a throw-away project where I do early binding, write the code and then copy the code to the main project while changing it to late binding.

ho1