Reputation: 179
I am getting the below mentioned error when my web service tries to open MS word document pragmatically through my .net web service. When I run web service through visual studio, it works fine but when I deploy web service on IIS 7, I get the error
Retrieving the COM class factory for component with CLSID
{000209FF-0000-0000C000-000000000046} failed due to the following error: 80070005
Access is Denied
at the following line.
Microsoft.Office.Interop.Word.Application oWordApp = new Microsoft.Office.Interop. Word.Application();
Microsoft.Office.Interop.Word.Document oWordDoc = new Microsoft.Office.Interop.Word.Document();
I have written this code in server side. It has to open the word document template and find and replace some values and save as with different name
Im using 64-Bit system and Office 2007. Can any 1 help me to fix out the problem.
Upvotes: 2
Views: 8659
Reputation: 103
I was just getting this error and it was solved by adjusting the permissions in the DCOM config on the server:
No reboot should be needed for this. If your app pool is running under a different user, add that user instead.
Upvotes: 5