Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.NET and Office Interop

Status
Not open for further replies.

jcmercure

Programmer
Oct 22, 2003
20
US
I hope I am posting in the right place. I am working on a .NET (C#) application that needs to support both Excel 2002 and Excel 2003.

I have been able to get the application to work with an Excel reference for Excel 2003 and 2003 running on the PC. I have also had it working with an Excel 2002 reference and Excel 2002 running on the PC. What I am having problems with is using a an Excel 2002 reference in the application with Excel 2003 installed on the PC.

How do I go about supporting both Excel 2002 and 2003 from a single version of the application?

Thanks in advance.

- John
 
I would write two separate assemblies, one for Excel 2002 and one for Excel 2003. Each would have references to their specific version of Excel.

I would then write a plug-in architecture (see Martin Fowler's book: Patterns of Enterprise Application Architecture), that would allow me to load the specific assembly, based on the version that the user has installed on their machine.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
Chip -

That sounds like a good idea and if I have to, I will go that route. Microsoft however offers PIA's for Excel and recommends using their assemblies for Excel (both versions).

It appears both PIA's can't exist in the GAC at the same time, so I can't do a plug-in with their assemblies.

Thanks for the advice, I will look into this.

- John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top