Can I still use Microsoft.Office.Interop assemblies with office 2013? -


i had import older project (in .net 2) visual studio 2013, makes use of microsoft primary interop assemblies.

visual studio said need add references project. went , did reading , apparently microsoft has released pia office 2010? (i have office 2013)

now know is.

  1. can work office 2013 , backward compatible?
  2. and if route go future? going compatible? because see need .net 2 (at latest) , windows 8 comes 4.5 , not 3 (by default) , new computers going have office 2012 or 2013.

pias historical artifact, required old .net versions (before v4). have been thoroughly , elegantly replaced "embed interop types" feature, known "no pia" feature. supported since visual studio 2010, you'll find in properties window when select reference assembly. defaults true. video covers underlying technology available here.

which reason microsoft doesn't publish pias office 2013, expect embed interop types instead.

the feature desirable, avoids customer having install pias on machine , include them installer. solving issue when neither takes care of it, entirely common mishap. in addition, pias office large, great advantage of embedding interop types assembly contain types use. many megabytes reduced few kilobytes.

the workflow little different. instead of adding reference microsoft.office.interop assemblies available in add reference dialog, .net framework tab, use com tab. , pick, say, "microsoft excel 15.0 object library" generate interop types program uses excel. if load old project used pias remove reference assemblies , add them com tab.

do note feature lost, intentionally targeting old version of office don't have installed on dev machine more difficult. if that's requirement still need pias version, force embed interop types true in properties window. doing questionable, microsoft has hard time keeping new office versions compatible old versions. they've kept 15 years has been running out of steam. worst-case scenario targeting newer version have installed on machine, that's liable make program crash very hard diagnose exceptions accessviolationexception.

do note have make small modifications code allow work. synthetic "xxxxclass" classes not embedded, "xxxx" interfaces. remove word "class" new statement.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -