简体   繁体   中英

Error when initializing Microsoft Excel interop (64-bit)

I have a website using asp.net with Excel 2010 Interop 64-bit (Microsoft.Office.Interop.Excel.dll).

I deployed code to the Windows Server 64 bit.

By using command:

xelApp = new Microsoft.Office.Interop.Excel.Application();

I see there is no error on this own server. But from the other computer (same domain), sometimes (not always), I got the error:

System.Runtime.InteropServices.COMException (0x8000401A): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a.

How could I fix this issue?

By install the Office 2010 64-bit to server 64-bit, I cannot see the Excel in DCOM config.

Please advise.

Thanks.

Check the folowing:

  1. Is Microsoft Office Installed on the server? If not, you may install the MS Office and this feature should be working.
  2. If you do not want to install the MS Office, you can use a similar tool, which is ClosedXML - 1 https://closedxml.codeplex.com/

I recommend to replace the Interop Excel with the ClosedXML.

由于权限不足等安全性问题或用户名,密码错误而导致发生该错误代码。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM