1

Facing issue in below code

using Microsoft.Office.Interop.Excel;

    var excel = new Application();  // this is throwing error

Error:

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a The server process could not be started because the configured identity is incorrect. Check the username and password.

I am trying to read excel present in SharePoint.

How to resolve above issue

komron
  • 2,267
  • 2
  • 17
  • 26
Chandra sekhar
  • 356
  • 2
  • 12
  • Automating Office like that from ASP.Net is not recommended or supported & can cause all kinds of issues even if you eventually get it into a state where it appears to work. Consider OleDb/EPPlus as alternatives. – Alex K. Nov 30 '18 at 11:22
  • Make sure the Interop Library you are using is the same version of Excel. Each version of Excel has a different Interop Library. – jdweng Nov 30 '18 at 12:16
  • And make sure that Office is installed on the server. As @Alex K mentioned, this is a really bad idea. Microsoft has said don't due this since the 90's in classic ASP days. The threading models are completely wrong and you can easily de-stabilize a server. If you need to read a file, use a component designed for it. For Excel 2010 and above, look at the OpenXML SDK from Microsoft. – Mark Fitzpatrick Nov 30 '18 at 13:31
  • I had the same problem and this answer work to me : https://stackoverflow.com/a/4974615/12920154 – Luiz Nogueira May 27 '20 at 14:03

0 Answers0