Summary:
This article troubleshoots the error, ""Retrieving the COM class factory for component with CLSID Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)"
Article Sections:
Symptoms:
A user receives the following error message:
Stopped after 10s
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
Executing \\<foldername>\decision support\BI360\1d Reports - Other\Employee Recruitment.xlsx (Period: 202005) [domain\username]
*ERROR* \\<foldername>\decision support\BI360\1d Reports - Other\Employee Recruitment.xlsx (Period: 202005) [domain\username]:
System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)
at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType)
at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj)
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at OneStop.Framework.Render.ExcelObject.AutoCloseWorkbook.Attach()
at OneStop.Framework.Render.ExcelObject.AutoCloseWorkbook..ctor(String templateFileName, String outputFileName, String tempName)
at OneStop.Framework.Render.ExcelObject.RenderExcelObject.d__33.MoveNext()
at OneStop.Framework.Render.RenderBase.Render(IJobEntryInstance ei, RenderResults results)
at OneStop.Controls.Publisher.JobHelper.RunSingleReport(IDefinitionReader reader, JobEntryConnection conn)
at OneStop.Controls.Publisher.JobHelper.ExecuteConnections(IEnumerable`1 connections, ProgressFunction fct) Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
Causes:
The error message indicates that the file is not accessible, the most likely cause of this is that the file being referenced by Publisher was left open by a user. Publisher requires that files are closed in order for Publisher to run them, make sure the file is closed and Publisher should run without error.
Additionally, this error can occur when the user failed to "Run as administrator" - verify that user is an admin user.
It is also possible that the BI360 Admin Service account (the account that is creating the Windows Tasks) may not have permissions to the Microsoft Excel Application in the Component Services.
Resolution:
Check the Launch and Activation Permissions, as well as the Access Permissions, in the Component services and update them
- From the Start menu, click Run and type Dcomcnfg.exe.
- In Component Services, click Console root, expand Component Services, expand Computers, expand My computer,expand DCOMConfig.
- Find the Microsoft Excel Application. Verify this is Application ID {00024500-0000-0000-C000-000000000046} (it's different for me, but I'm guessing I have a different version of Excel). If it is, move on to step 4. If not, stop here as we need to find the Component Service that corresponds to this CLSID.
- Right click and select Properties.
- On security tab, select Customize in "Launch and Activation Permissions" section.
- Click edit and add identity of the BI360 Admin Service account.
- Repeat steps 6 and 7 for "Access Permission"
If the BI360 Admin Service account is already listed in the Security for both Launch and Activation Permissions section and the Access Permissions with all the Security Permissions, Support may need to be reached out to to verify items in the Component services to determine what is causing the issue. If the Security Permissions are not there, update them.
Test creating a new subscription from scratch and ensure the following:
- Have a generic admin account for windows with permissions to BI360 Admin/Publisher
- Have that account set to run all the Tasks in Task Scheduler with highest privileges
- Ensure ‘Send to administrator’ is selected.
Properties:
Publisher
BI360