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.

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

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 !