views:

28

answers:

1

i have a web service that reads data from excel using Microsoft.Office.Interop.Excel. It works fine on my local machine but when i upload it on a server it gives the following error

Server was unable to process request. ---> Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.

i googled and tried to follow the suggestion of DCOMCNFG-> component services-> computers-> my computer-> com+ appications but then i dont find the Microsoft excel to change rights. Office 2003 is installed in server and file i am trying to open is 2003 too. Please help!! Thanks

+1  A: 

You won't find Excel, you'll have to find the matching CLSID and alter the Activation/Launch permissions.

Standard Disclaimer: Unattended execution of office on the server is not recommended by Microsoft, but a lot of us do it happily (myself included).

RandomNoob
ok i am not very familiar with this.can you explain in more details what do i need to find?i dont see the CLSID.
medusa
When you go to DCOM Config: Start|Run|dcomcnfg. Expand Component Services | My Computer | DCOM Config . A big list will load, if you scroll down to the bottom you will see GUIDS like you mentioned in your post - find -> {00024500-0000-0000-C000-000000000046} - when you find it, right click | properties - Go to the Security Tab - Select Custom Launch and Activation permissions - set the identity you want to allow to launch excel as is there. You could try setting it to the identity that your App Pool is running on, I don't know the specifics of your implementation so..
RandomNoob
thank you very much for your reply,it helped, i found it, but now im stuck again. what user should i add and give permissions? how to find the user that represents my application that wants to launch excel? just one last help please..
medusa
Hmm, without knowing how your service is set up, I'll take a stab in the dark, can you find what identity your web service in IIS is running as, if this is IIS6 or above you can check the Application Pool, give it a specific identity to run as (like a service account), or if it is running as Network service, give Network Service launch/activation permissions
RandomNoob
thank you!!!! it worked finally
medusa