I am using office 2007 interop DLL to create an Excel sheet in c#.NET.
when I tried to test my app on a machine with office 2003 installed I get an exception because of the version number of the DLL . How can I determine in runtime what version of office is installed and then load the appropriate interop DLL for that version ?
If you do not need features which became available in Office 2007, just use an interop dll for old versions of Office also when current Office is installed! A PIA created with Office XP still works with Office 2010.
Otherwise, you have to find out the registry keys of Excel...