locked
ASP.net PowerPoint Interop Does not Open or Save on IIS 7.0 RRS feed

  • Question

  • User1042036992 posted

    Dears,

    I have developed a web page that generates PowerPoint files using Office Interop Assemblies 2007. When deployed on Windows 2003 Server (IIS 6) it works fine.

    When deployed on Windows 2008 Server (IIS 7) i get errors with the Open and SaveAs methods. The creation of slides or any related objects of PowerPoint works fine.

    Open method call error: PowerPoint Cannot Open The File (It's not permission problem)

    SaveAs method call error: ...

    Sample code to test on Windows 2008:

    using Microsoft.Office.Core;
    using PowerPoint = Microsoft.Office.Interop.PowerPoint;

    public class PowerPointGenerator
    {

    private void CreatePowerPoint()
    {

    PowerPoint.ApplicationClass objPPT;
    PowerPoint.PresentationClass objPresCl;
    string strPth = @"C:\AnyPath\"; //Give permissions to the folder
    objPPT = new PowerPoint.ApplicationClass();
    objPPT.Visible = MsoTriState.msoTrue;
    objPPT.WindowState = PowerPoint.PpWindowState.ppWindowMaximized;
    objPresCl = (PowerPoint.PresentationClass)objPPT.Presentations.Add(MsoTriState.msoTrue);
    objPresCl.Slides.Add(1, Microsoft.Office.Interop.PowerPoint.PpSlideLayout.ppLayoutTitleOnly);
    objPresCl.Slides.Add(2, Microsoft.Office.Interop.PowerPoint.PpSlideLayout.ppLayoutText);
    objPPT.Presentations[1].SaveAs(strPath + "Output.ppt", Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType.ppSaveAsDefault, MsoTriState.msoTrue);

    .
    .
    .

    }

    private void UpdatePowerPoint()
    {

    PowerPoint.ApplicationClass objPPT;
    PowerPoint.PresentationClass objPresCl;
    string strPth = @"C:\AnyPath\"; //Give permissions to the folder
    objPPT = new PowerPoint.ApplicationClass();
    objPPT.Visible = MsoTriState.msoTrue;
    objPPT.WindowState = PowerPoint.PpWindowState.ppWindowMaximized;
    objPresCl = (PowerPoint.PresentationClass)objPPT.Presentations.Open(strPath + "Sample.ppt", MsoTriState.msoCTrue, MsoTriState.msoFalse, MsoTriState.msoCTrue);

    .
    .
    .

    }

    }

     

    //Thanks :)

    Thursday, March 25, 2010 5:18 AM

All replies

  • User-1853252149 posted

    It's not permission problem)

    How do you know?  What pipeline?

    Jeff


    Thursday, March 25, 2010 2:50 PM
  • User1042036992 posted

    Because I gave full permission to everything and still it did not work

    I know that my problem is not in the PowerPoint assembly and it's in the Office assembly because the PowerPoint objects are working fine and the problem is in the Open and SaveAs

    Can you try it as a website on 2008 server and tell me what u get? 

    Thursday, March 25, 2010 8:11 PM
  • User1818811909 posted

    wow....same problem here and we have tried everything including opening every security vulnerability known to web servers.  Ours ran great on 2003, but now chokes on the open command after migrating to 2008.  Any luck on your end?  Still hunting and hacking for an answer here and if I find one, I will post it back.

    Monday, May 10, 2010 2:35 AM