c# - Can't get Microsoft.Office.Interop reference to work -


i have c# winforms app , trying open excel sheet. when try add reference microsoft.office.interop, "office" part red , says "can't resolve symbol 'office'".

when attempt build, error is:

the type or namespace name 'office' not exist in namespace 'microsoft'      (are missing assembly reference?) 

i have office 2012 installed, , think have primary interop assemblies installed... i'm not positive.

i know should easy, i've been looking around answer hour , can't figure out. in advance!

you need add reference project. (assuming visual studio 2010)

in solution explorer can right click on references tree , choose "add reference." choose .net tab , "microsoft.office.[...]" components. add ones need. think excel may suffice (you may have trial , error on ones).

references http://oi39.tinypic.com/65010w.jpg

reference add box http://oi40.tinypic.com/260qv7b.jpg


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -