1

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 (E_ACCESSDENIED)).

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);
3

4 Answers 4

4

None of the answers on web worked for me for the same issue on Windows Server 2012 R2 (Azure). Here's the narrowed down solution which worked on all the servers.

  1. Installed Office and activated the product on every servers
  2. Created a folder 'Desktop' at C:\Windows\SysWOW64\config\systemprofile\Desktop (64 bit OS) enter image description here
  3. In IIS changed ApplicationPool identity from 'ApplicationPoolIdentity' to 'LocalSystem'. enter image description here

That's it and i was able to convert slides into images.

Source Code

In case you are interested in code that I was using:

Application pptApplication = new Application();
Microsoft.Office.Interop.PowerPoint.Presentation pptPresentation = pptApplication.Presentations.Open2007(Server.MapPath("~/tempslides/pptfilename.pptx"), MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
List<string> files = new List<string>();
for (int i = 1; i <= pptPresentation.Slides.Count; i++)
{
    pptPresentation.SaveCopyAs(serverPath + randomId, PpSaveAsFileType.ppSaveAsPNG, MsoTriState.msoTrue);
    files.Add(Server.MapPath("~/tempslides") + "/slide" + i + ".PNG");
}
pptPresentation.Close();

To run above code, you need to add reference to interop lib in your project. enter image description here

Hope this helps you to save your time.

2

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.
8
  • Go To Registery and Find {91493441-5A91-11CF-8700-00AA0060263B} ** and Check user is **Network Service or other User Oct 14, 2015 at 7:37
  • It is under Local Machine Oct 14, 2015 at 7:42
  • Go To IIS > Select Your Application Pool > Advenced Setting > identity> Chenge To NetWork Service Oct 14, 2015 at 7:42
  • Done but i have change it to local system not network service Oct 14, 2015 at 7:52
  • How to make it work in Azure as i am not able to configure iis application pool identity in the Azure Hosting Oct 14, 2015 at 7:53
0

You should give permissions to "This User" and then get login credentials in COM+ settings.

0
0

I have followed the below actions to resolve the issue.

1) Go to Control Panel - > Administrative Tools - > Component Services -> Computers -> My Computer -> DCOM Config -> Microsoft Office Power point Right click and select Properties. Select the Security tab. and Provided the full Access to IIS_IUSR for all the three access for Launch and Activate Permissions , Access Permission and Configuration Permission.

2) Set the Application Pool Identity as "LocalSystem"

3) Provide Full Access to IIS_IUSR for the folder where the Microsoft.Office.Interop Dll deployed

Eg : C:\Program Files (x86)\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.