Retrieving the COM class factory for component with CLSID

I am facing problem to convert word doc to PDF in vb using Interop.Word.Document.
below is my code
Dim word As Application = New Application()
            Dim wordDocument As Microsoft.Office.Interop.Word.Document = word.Documents.Open(rootPath + file.Name)
            wordDocument.SaveAs(rootPath + Path.GetFileNameWithoutExtension(file.Name) + ".pdf", WdSaveFormat.wdFormatPDF)

It works fine in local system. I am getting an exception on production server as below.

Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a The server process could not be started because the configured identity is incorrect. Check the username and password. (Exception from HRESULT: 0x8000401A).

 I am using the Windows server 2008 standard edition with 64 bit operating System.

Please help me to solve this problem
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ASP.NET processes in IIS are running under some user account specified in application pool settings. User account specified for your server has no access to COM objects installed on the server.

You could try the following options:
check whether Microsoft Office primary interop assemblies (PIAs) are installed or not;
check permission of user account used in application pool and probable use another one;
run this conversion process under another user account having necessary permissions after imperonation. And if you already use imperonation, check settings on login and password.

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.