Home > Software engineering >  Excel Interop Library Not Working on Azure
Excel Interop Library Not Working on Azure

Time:12-21

Right now ,I am working on Excel Import. It is working fine on my local machine but when I deploy on Azure app services it does not since no access to actual environment where we can install dependencies, Please let me know if there is alternate to fix this issue.

Exception

System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

Thanks

CodePudding user response:

Package your app and its dependencies in a Windows container and run this container in App Service.

CodePudding user response:

The question is not about dependencies. It seems you are trying to automate Excel from an external application. But Excel is not installed on Azure app services since there is no access to actual environment where Office can be installed.

Moreover, Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. Read more about that in the Considerations for server-side Automation of Office article.

Consider using the Open XML SDK instead if you deal with open XML documents only, see Welcome to the Open XML SDK 2.5 for Office for more information.

  • Related