COM Exception 80040154 When creating an Excel Application

前端 未结 2 1142
再見小時候
再見小時候 2021-01-13 11:39

I\'m trying to run my application on a server which does not and will not have Office installed on it.

using EXCEL = Microsoft.Office.Interop.Excel;
...
EXC         


        
相关标签:
2条回答
  • 2021-01-13 11:50

    The Office Interop assemblies are runtime-callable wrappers (RCW) that allow you to interoperate with a copy of Office that's installed on the system via the COM API that it exposes.

    The error message indicates that Excel isn't installed, exactly what I'd expect. You can't use the Interop assemblies on a machine without Office.

    0 讨论(0)
  • 2021-01-13 12:04

    I'm trying to run my application on a server which does not and will not have Office installed on it.

    As Joe said, you'll need to install Excel for Interop to work. If you're dead-set against that, consider third-party alternatives. In general, Microsoft does not recommend installing Office on your server and using it with Interop - that being said, it will work (at least most of the time).

    0 讨论(0)
提交回复
热议问题