Waiting for Powerpoint to finish

T

Thomas Tutko

I have a VB.NET project that pulls data from an access database and creates a
power point presentation using that data at the click of a button. After the
presentation is built, i use ppPres.SlideShowSettings.Run() to run the
presentation and then the presentation is saved, closed, and Powerpoint
application is exited (ppObj.Quit()). The problem I am having is that I want
the user to be able to see the presentation and click through it until it
exits before powerpoint is closed. Currently it is flashing the presentation
on the screen for a very brief moment and then shutting down. How do I make
my program wait for the presentation to end?

I know that this is not directly programmed in Access anymore but it was
originally and the same problem existed, which is why I am posting this
question here. Thanks for any responses in advance.
 
D

Dan Artuso

Hi,
Without seeing *any* code, I'd guess your application variable is going out of scope.
 
T

Thomas Tutko

Here is the code of the area I am having the trouble in:

' Run the show if user requests to.
If chkRunPpt.Checked = True Then
Dim objSlideWnd As PowerPoint.SlideShowWindow

objSlideWnd = ppPres.SlideShowSettings.Run()
objSlideWnd.Activate()


End If

' Save File
ppPres.SaveAs(txtPptFile.Text)

' Close powerpoint presentation and Powerpoint
ppPres.Close()
ppObj.Quit()

I need to wait for the Presentation to quit running (IE the user clicks
through it) before the SaveAs, Close, and Quit methods are called.

Tom
 
D

Dan Artuso

Hi,
Here's what I would do.
Run the code to create and save the presentation, then run code to start it.
That way you don't have to wait for anything.
 

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