C#操作Office- Cannot find the interop type that matches the embedded interop type 'Microsoft.Office.Interop.Excel.Application'

时间:2022-11-04 08:28:43

网上说

2003 -> 11.0,

2007 -> 12.0.

  因为平时提示"Are you missing an assembly reference?",都是没有引用库文件,但是明明我已经添加好引用了,还是报错.机器上安装的是Office2010,但是在库引用中,v14.0的是不行,Office 2010中的 Excel还是用v12.0.

  处理题目中的错误,是将库文件中的"Embedded Interop Type"属性设置为false即可.(突然记得'embedded interop type',所以猜测,竟然猜对了).