Powerpoint with VBA help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've got a userform in a powerpoint presentation that customizes the
presentation to the user's specifications based on predetermined options.

The userform and macros work fine on only two computers. One with
Powerpoint 2002 with SP3 and the other with Powerpoint 2003. Ironically,
these are the two computers where the two coders (myself and my boss) sit.

On other computers, however, there is a problem. The code follows:
On Error GoTo Errorhandler

Application.Run "'CAS.ppt'!Loading"
Customize:
Application.Run "'CAS.ppt'!Customize"
EP:
Application.Run "'CAS.ppt'!eptod"
Airspace:
Application.Run "'CAS.ppt'!Airspace"
Weapons:
Application.Run "'CAS.ppt'!Weapons"
Attacks:
Application.Run "'CAS.ppt'!Attacks"
SEM:
Application.Run "'CAS.ppt'!SEM"
Other:
Application.Run "'CAS.ppt'!Other"
Done:

UserForm1.Hide


ActivePresentation.SlideShowSettings.Run

SlideShowWindows(Index:=1).View.Next
Unload UserForm1

Exit Sub
Errorhandler:
MsgBox ("It's broke, sorry - loading slideshow")
GoTo Done

The hangup is userform1.hide Instead of hiding the userform, it reloads the
userform and presents it on top of the presentation. On the two computers,
it does as it should and hides the userform, but everywhere else it reloads
it (with the values cleared) on top.

When the command Userform1.hide is commented out, it runs the show on top
and leaves the userform in the background.

Why is it doing this, how do I fix it, and why would it work on two
computers (with different versions of Powerpoint) and not others with the
same versions?

Thanks
 
Offhand I'd guess that your errorhandler's the problem.
Generally, invoking any property or method of a form causes the form to load.
Any error in your code will cause the form's .Hide method to be invoked,
causing the form to load, then unload.

As a test, lose the "GoTo Done" in the error handler.

If that doesn't help, comment out the On Error GoTo Errorhandler and see where
it's actually erroring out.
 

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

Back
Top