The type 'Microsoft.Office.Interop.Excel.ApplicationClass' has no constructors defined

The type 'Microsoft.Office.Interop.Excel.ApplicationClass' has no constructors defined

Interop type 'Microsoft.Office.Interop.Excel.ApplicationClass' cannot be embedded. Use the applicable interface instead.

---Solution---

Disable embedding of Interop types for this assembly (References -> Microsoft.Office.Interop.Outlook (right click) -> Properties -> Set 'Embed Interop Types' to False)

More info on the why can be found here: http://blogs.msdn.com/b/mshneer/archive/2009/12/07/interop-type-xxx-cannot-be-embedded-use-the-applicable-interface-instead.aspx

原文地址:https://www.cnblogs.com/vincentDr/p/2861299.html