Powerpoint Macro

P

Pooks

Wrote the following powerpoint macro on an IBM and it runs just fine. But it
doesnt work on a Dell. Why?

Sub Close_All_Open_Presentations()

With Application.Presentations
For i = .Count To 1 Step -1
SlideShowWindows(i).View.Exit
Next
End With

End Sub

Also, hit Ctrl+Q on an IBM and it closes all open presentations. Doesn't do
anything on a Dell. Why?
 
B

Bill Dilworth

There is no difference in the way the macros run on these machines. The
question should be, "does the macro run?"

After the Next command add --
Msgbox "Done."

Does it display on both machines? Chances are that Macro security is set to
High on the Dell, but not on the IBM. This would preclude it running on the
Dell.


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
yahoo2@ Please read the PowerPoint
yahoo. FAQ pages. They answer most
com of our questions.
www.pptfaq.com
..
..
 
C

Chirag

That macro is iterating over all presentations and closing slide shows. Is
that what you intended? I mean, you wanted to close the presentations or
their slide shows? If you want to close only the slide shows, the following
macro would do the job:

---
Sub CloseAllSlideShows()
Do While SlideShowWindows.Count > 0
SlideShowWindows(1).View.Exit
Loop
End Sub
---

If you want to close all open presentations, the following macro does that:

---
Sub CloseAllPresentations()
Do While Presentations.Count > 0
Presentations(1).Close
Loop
End Sub
---

- Chirag

OfficeOne Animations - Add over 50 animation effects to PowerPoint
http://officeone.mvps.org/anims/anims.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