Can't find Microsoft Excel Application with CLSID {00024500-0000-0000-C000-000000000046}

AriBK 5 Reputation points
2023-10-17T12:53:17.4133333+00:00

Hello,

I write my question here because I could not find answer after hours and hours searching on the web.

I have set up SSIS package with C# code getting excel file data with this line :

using Excel = Microsoft.Office.Interop.Excel;

When I launch this on my local machine this works as a charm, but after deploying it on production server, the package stops with the following error :

Get data from Excel file:Error: System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access Denied . (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
   at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)
   at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PrimeOutput(Int32 outputs, Int32[] outputIDs, PipelineBuffer[] buffers)
   at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPrimeOutput(IDTSManagedComponentWrapper100 wrapper, Int32 outputs, Int32[] outputIDs, IDTSBuffer100[] buffers, IntPtr ppBufferWirePacket)

Microsoft Office 2021 LTSC Professionnal Plus in installed on that Microsoft Server 2022.

I added the user who runs the package to Administrator group --> works well but really not good to keep it as it is.

I saw on the web that giving proper access can solve my problem, I found that thread : https://stackoverflow.com/questions/17785063/retrieving-the-com-class-factory-for-component-error-80070005-access-is-de

But now here is my real problem, I need to grant proper access to Microsoft Excel Application with CLISD {00024500-0000-0000-C000-000000000046} but I can not find it.

I can launch both DCOMCNFG (64bit version) or MMC -32 (to retreive apps with 32bit compatibility) but no CLSID {00024500-0000-0000-C000-000000000046}. Instead I have the Microsoft Excel Application with CLSID {00020812-0000-0000-C000-000000000046} and of course I can set any properties it does not affect my original error message.

User's image

I also tried to grand access to MyServ\Users in the "Poste de travail" properties (= "My Computer" in french) but not working, and I can not find the NetworkService account so maybe something missing from there ?

But in the Register editor, I can find the Excel Application with correct CLSID

User's image

I already know that using Microsoft Office Interop on server is not recommendend but I need to use it to get Table attributes (no possibility to retreive table on OLEDB, csv files or XML formats)

Please help me understand this thing, any help is welcome !

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,702 questions
Microsoft 365 and Office Excel For business Windows
Windows for business Windows Server User experience Other
Developer technologies C#
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. AriBK 5 Reputation points
    2023-10-25T12:12:11.3133333+00:00

    Hi,

    I found a way to solve my problem, it was due to Office installed with 32bits version on a 64bits Windows Server OS.

    To solve this, I changed some keys in the registry editor and proceed as follow :

    • Open registry editor by taping "regedit" in a run command :

    User's image

    • Navigate to "HKEY_CLASSES_ROOT\AppID" and locate the key {00020812-0000-0000-C000-000000000046}. Right click and click Rename :

    User's image

    • Now set the value {00024500-0000-0000-C000-000000000046} and press Enter to validate :

    User's image

    • Now, close the registry editor and run DCOMCNFG. Expand Component services > Computers > My Computer > DCOM Configuration and search for Microsoft Excel Application. Magic ! Correct CLSID is now appearing, you can right click, select properties and grant access to the necessary accounts :

    User's image

    Hoping that this topic can help people

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.