c# - How can I determine the version of Microsoft.Office.Interop.Excel on a client computer? -


i have application needs use microsoft.office.interop.excel assembly (nothing crazy, simple writing worksheets).
@ compile time, using microsoft.office.interop.excel 15.0. have office 2013 installed , works expected.

but that's irrelevant in terms of if client can use it.

how can programatically determine version of interop.excel user has installed? once know version have, how can load assemblies @ runtime gain access interop objects? if user has, example, interop.excel 14.0 installed, mean have excel installed too? how should check version of excel installed?

i know user needs office installed in order use interop.excel objects, mean need checking both office version interop assembly version?

we plan support excel 2007, 2010, , 2013.

in short -- how cover of bases here?

there plenty of questions out there interop.excel nothing has made clear me:

a) need check on client computer

b) how checks through reflection(avoid registry lookup)

thanks.

if user has, example, interop.excel 14.0 installed, mean have excel installed too?

no, interops used marshalling calls managed programming languages unmanaged applications.

how should check version of excel installed?

typically windows registry used detect installed office versions. note, there can multiple office versions installed on pc. may try run office application programmatically , check out version property @ runtime. see how automate microsoft excel microsoft visual c#.net more information.

we plan support excel 2007, 2010, , 2013. in short -- how cover of bases here?

use oldest interop whcih corresponds lowest office version need support. thus, sure use methods , properties available in office versions. or embedd interop assemblies (types) application. feature available when target .net 4.0 , later.


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -