PPT Crashes on Dual Monitor.

G

Guest

I am working on PowerPoint Automation.

I have an external application that runs PowerPoint slideshow. When I run my
app it creates a ~temp.ppt file as a copy of the active ppt and runs the
slideshow for that. I have been able to trap the events. On "SlideShowEnd" I
am closing this ~temp.ppt file:
Sub PPTEVENTS_SlideShowEnd(Pres as Presentation)
if Pres.Name="~temp.ppt" then
Pres.Close
Endif
End Sub

This works fine for single monitor. But, when I do this for dual monitor
(with Presenter view enabled) I get PowerPoint crash error message when the
line Pres.Close is executed. I am not sure what is happening in Dual Monitor
that makes PPT crash while executing this line. I searched on the net and got
an article related to corrupted VBE6.dll file but that didn't helped me.
One more thing I observed was if I click "End Show" button on the presenter
view then it closes the ~temp.ppt file without any error message.

Can anyone tell me what could be the possible reason for this? This is
really urgent.

Thanks a lot in advance.
 
C

Chirag

Instead of closing the presentation in the SlideShowEnd event handler, try
closing it in your application's main thread through the message loop.
Basically, post a user message in the SlideShowEnd event handler and write
the user message handler that closes the presentation. This way, you will
use the automation interfaces in the same thread that started PowerPoint.

Let me know if this helps.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
G

Guest

I changed the code such that I am not closing the Presentation in the
SlideShowEnd event sub. I am not calling a function in the SlideShowEnd which
is present in my external application.
--------------------------------------------------
Sub PPTEVENT_SlideShowEnd(Pres as Presentation)
Set objMyApp = CreateObject("MyApp.clsMyApp")
Call objMyApp.SlideShowClose
End Sub
---------------------------------------------
And in my external App (which I am implementing as a dll) I have written
App_.ActivePresentation.Close where App_=PowerPoint.Application, in the
subroutine SlideShowClose().

But, I am still getting the PowerPoint crash message whenever PPT close code
is executed.

Any suggestions?

Thanks.
Anurag
 
C

Chirag

Its the same thing whether you try to close the presentation in VBA or
through an external DLL. Try the solution that I suggested earlier. Use
PostMessage() Windows API and post a WM_USER message to your application's
main window. Close the presentation in the handler for WM_USER message.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top