Share via

Regarding using COM component PowerPoint.Application with PHP on IIS on Windows Server2012 R2

Anonymous
2016-11-21T13:40:12+00:00

Hi Microsoft!

We have cloud server on whcih we have:-

Operating Server: Windows Server 2012R2

Office: MS Office 2013

Powerpoint: Powerpoint2013

Web-server: IIS

Application dev language: PHP

We are using following code to generate images for powerpoint slides using COM component i.e. PowerPoint.Application

$ppApp = new COM("PowerPoint.Application");

                $ppApp->Visible = True;

                $strPath = public_path('/uploads/lessons/'.$last_inserted_id); // C:/AppServ/www/myphp

                $ppName = public_path('uploads/lessons/'.$fileName); // [path of file

                //*** Open Document ***//

                $MyPres  = $ppApp->Presentations->Open(realpath($ppName));

                //*** Save Document ***//

                $ppApp->ActivePresentation->SaveAs($strPath,17);  //'*** 18=PNG, 19=BMP **'

                $ppApp->Quit;

                $ppApp = null;

If we upload one power-point slide show of size around 18mb, it works fine. But when we upload multiple files then COM component does not respond and gives "Call was rejected by callee" error message. In this case either we have to restart IIS or Windows Server itself. Once this error came-out then the server does not able to convert slides into images for single ppt file even. It works only after restarting the server. Sometimes it gives following error:-

Error [0x80010001] Call was rejected by callee.

What and where we are doing wrong in using PowerPoint.Application to convert multiple PPT ot PPTX files into images.

Please help to fix this issue.

Thanks

Aman

Microsoft 365 and Office | PowerPoint | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2016-11-22T16:27:07+00:00

    Try the following:

    1. Remove the line that attempts to make PowerPoint visible:

    $ppApp->Visible = true; // remove this line.

    1. Change the line after Open Document comment to the following:

    $MyPres = $ppApp->Presentations->Open(realpath($ppName),false,false,true);

    1. Change the line after Save Document comment to the following:

    $MyPres->SaveAs($strPath,17);

    Also, see if you can start PowerPoint.Application only once rather than for every presentation uploaded. Similarly, don't quit the instance every time.

    • Chirag

    <edited by the moderator>

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-11-22T11:39:59+00:00

    Hi Aman,

    Let's post this question to Microsoft TechNet Forum for better assistance.

    Regards.

    Was this answer helpful?

    0 comments No comments