I am working on a project in which I am having template in word. I am filling data from database to word and then after converting word to pdf.
It providing me error as shown
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
As Anders pointed out, look into the DCOM. Your COM error definitely identifies Access Denied which is obviously permissions.
From the Windows Search, enter "COM" and select Component Services.
In that dialog, expand services, computers, my computer, DCOM Config, scroll down your list to find your COM object (I just sampled with a generic one). Right-click - properties.
Look at the security tab. Under the "Launch and Activation Permissions", click edit. It SHOULD show administrators by default. Then go to the last tab for "Identity". The default is the "interactive user" account which may be restricted to what your COM is trying to do.
Click the radio button for "This user" and fill in a user and password of a valid user (such as administrator for TESTING ONLY) and try the COM access. Once you confirm it WILL work, now you can drop this down by creating a specific user for the sole purpose of having access to the resources, paths, locations, files, etc. the COM service needs. Then change the "This user" to that account and test again.
By STARTING (and only for test purposes) with the administrator account, you know you should have no "access denied" issues. Once confirmed, you know your COM works and can downgrade the use to the specific one you create.
User contributions licensed under CC BY-SA 3.0