Neeraj Mehta Neeraj Mehta - 1 year ago 92
C# Question

Not Able To upload Ppt and read in IIS Server

I am uploading PPT files where i am converting ppt silde into images.When i am running in visual studio its working fine but when i am Publising the code to IIS server i am getting Following Error

Retrieving the COM class factory for component with CLSID
{91493441-5A91-11CF-8700-00AA0060263B} failed due to the following
error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005

Code For This :

Microsoft.Office.Interop.PowerPoint.Application PowerPoint_App = new Microsoft.Office.Interop.PowerPoint.Application();
Microsoft.Office.Interop.PowerPoint.Presentations multi_presentations = PowerPoint_App.Presentations;
Microsoft.Office.Interop.PowerPoint.Presentation presentation = multi_presentations.Open(filePath, MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);

Answer Source

Configure DCOM

  1. Go to Start -> Run.

  2. Type DCOMCNFG. (This will load the "Component Services")

  3. Go to Component Services -> Computers -> My Computer -> DCOM Config -> Microsoft Office Power point

  4. Right click and select Properties.

  5. Select the Security tab.

In Launch and Activate Permissions

  1. select Customize and press the Edit button.
  2. Press Add button to select the "Network Service" account.
  3. Give permission to Local Launch and Local Activation Click the OK button, and then test your application, it should work fine now.