Bug:Interoptype 'Microsoft.Office.Interop.Excel.WorkbookClass' cannot be embedded. Use theapplicable

using Excel= Microsoft.Office.Interop.Excel;

当使用 Excel.WorkbookClass wbclass;时报错

Interoptype 'Microsoft.Office.Interop.Excel.WorkbookClass' cannot be embedded. Use theapplicable interface instead

解决办法:去掉WorkbookClass 中的“class”后缀。使用Excel.Workbook即可!

猜你喜欢

转载自blog.csdn.net/wangyue4/article/details/8583032