There are times when you may want to configure permissions for Excel in the DCOM configuration tool. This is a fairly straightforward process if you follow http://msdn.microsoft.com/en-us/library/ms678426(VS.85).aspx - "Setting Process-Wide Security Using DCOMCNFG". But you may run into a problem where "Microsoft Excel Application" doesn't appear in DCOM. Additionally, you may receive the following error when working in your application:
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005
To view whether "Microsoft Excel Application" does appear in the DCOM list, you need to open the DCOM configuration tool in Windows. It's important to note that if you install 32-bit Microsoft Office on a 64-bit machine, you may need to use the 32-bit DCOM config manager to view the programs, depending on your operating system.
"On x64 operating systems from Windows XP to Windows Server 2008, the 64-bit version of DCOMCNFG.EXE does not correctly configure 32-bit DCOM applications for remote activation. This behavior causes components that are meant to be activated remotely instead being activated locally. This behavior does not occur in Windows 7 and Windows Server 2008 R2 and higher versions." - http://msdn.microsoft.com/en-us/library/windows/desktop/ms678426(v=vs.85).aspx
To correctly configure 32-bit DCOM applications for remote activation, follow these steps:
From a command line, enter the following:
C:\WINDOWS\SysWOW64>mmc comexp.msc /32
You should be able to see "Microsoft Excel Application" in the list. However, if the entry is still missing after taking this step, or when on Windows 7 or Windows 2008 Server R2, try the following to resolve:
Restart the Machine
After an install of Office 2007 or 2010 a reboot of the operating system may be necessary for the appropriate reg keys to be added. A restart of the machine is the quickest and easiest way to resolve this problem, though if the problem remains, you may need to take further steps.
Re-Register the Excel Application
From a command prompt, navigate to where the Excel.exe is located and re-register the application. On a 64-bit machine, this is located (by default) under C:\Program Files (x86)\Microsoft Office\Office14 for Office 2010 and C:\Program Files (x86)\Microsoft Office\Office12 for Office 2007.
1. Open a command prompt – START, RUN, type CMD.EXE but don’t hit ENTER just yet
2. Find CMD.EXE in the ‘All Programs” list. Right click it and left click on “Run as administrator”
3. This should open a command prompt. Now, type the following:
CD\
And hit ENTER
CD C:\Program Files (x86)\Microsoft Office\Office14
And hit ENTER
EXCEL.EXE –REGSERVER
And hit ENTER
Modify Access and Activate Permissions
1. In DCOMCNFG, right click on the My Computer and select properties.
2. Choose the COM Securities tab
3. In Access Permissions, click "Edit Defaults" and add Network Service to it and give it "Allow local access" permission. Do the same for <Machine_name>\Users.
4. In launch and Activation Permissions, click "Edit Defaults" and add Network Service to it and give it "Local launch" and "Local Activation" permission. Do the same for <Machine_name>\Users
5. In DCOMCNFG where you see your list of applications, click Action > Refresh
Verify that the Reg Key Exists
1. Launch the registry editor (START, RUN, type REGEDIT and hit ENTER)
2. Navigate to
HKEY_CLASSES_ROOT\AppID\{00020812-0000-0000-C000-000000000046}
3. If this key does not exist, "Microsoft Excel Application" will not show up under DCOMCNFG. You will need to import this key from a working machine. Alternatively, you can check the permissions on the AppID key to make sure that the proper permissions exist for entries to be made to this registry key. Right click the AppID key and left click Permissions. The permissions groups listed SHOULD be inheriting permissions from the HKCR key. Remember, if the checks in the boxes are grayed and cannot be checked or unchecked, this means they are inheriting permissions from their parent. A black check mark means this key is not inheriting permissions from the parent and can be set here. Under the "group or security names" window you should see the following:
CREATOR OWNER - with "special permissions" checked
SYSTEM - with "Full Control" and "Read" checked
Administrators ([Machine Name]\Administrators) - with "Full Control" and "Read" checked
Users ([Machine Name]\Users) - with "Read" checked
If the permissions on AppID are not correct, add the correct permissions to the key and try a repair of office and then restart the machine.