Supercharge your PowerPoint productivity with
Supercharge your PPT Productivity with PPTools - Click here to learn more.

Proud member of

PPTools

Image Export converts PowerPoint slides to high-quality images.

PPT2HTML exports HTML even from PowerPoint 2010 and 2013, gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements

Merge Excel data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more

Resize your presentations quickly and without distortion

Language Selector switches the text in your presentation from one language to another

FixLinks prevents broken links when you distribute PowerPoint presentations

Shape Styles brings styles to PowerPoint. Apply complex formatting with a single click.

Macros that work in Normal/Slide view don't work in Slide Show view

Problem

You have macros in your presentation. They seem to work as expected when you run them from normal view, but they don't work in Slide Show view. Why not?

Check the file name

It at least some versions of PowerPoint, macros won't run in slide show view if there's an exclamation point ( ! ) in the file name of the presentation.

Rename the presentation to remove the exclamation point and the macros will run as expected.

Recorded macros

In PowerPoint 2003 and previous, you can use the macro recorder to generate VBA code that reproduces ... more or less ... the steps you perform manually so that you can play them back .... more or less ... later automatically.

Here's the problem though ...

When you record macros in normal slide view, you select something, you change it in some way, and that's what the macro recorder picks up. The code it creates always deals with the currently selected shape or shapes.

Because you can't select anything in Slide Show view, macros that depends on the current selection simply can't work.

So to fix it, I need to ..... do what?

You need to work directly with the shapes on the slides rather than working with the current selection.

For example, if you record yourself moving something, you'll get:

With ActiveWindow.Selection.ShapeRange
    ' do something here to change coordinates
End With

To make it work in slide show view, you need to know the object's name. Select it in normal view, then run this macro to learn its name:

With ActiveWindow.Selection.ShapeRange(1)
    MsgBox .Name
End With

The names PowerPoint gives shapes aren't very helpful, so you might want to create your own names. That's equally simple:

With ActiveWindow.Selection.ShapeRange(1)
    .Name = "Type a name you like here"
End With

Just remember that a shape name can only be used once per slide; two shapes cannot have the same name, except when bugs in PowerPoint make it happen. We'll ignore that for now.

The PPTools Starter Set Plus includes an object naming tool that makes this simpler to do.

Once you know an object's name, you can get at it in slide show view:

Sub MoveItInSlideShow()
  With SlideshowWindows(1).Presentation.Slides(1).Shapes("MyThing")
      ' Do whatever you like with it
  End with
End Sub

Note: don't forget to change .Slides(#) to the appropriate slide number above.

Now you can assign the object's Action setting to Run Macro, and choose MoveItInSlideShow and you're in business.

Or even better ... if you write your macro like this, you can assign it to any shape as an action setting; PowerPoint will hand the macro a "reference" to the shape when you click it in slide show view. The macro automatically knows what shape was clicked, no matter what its name is or what slide it's on: For example, this will move the clicked shape down and to the right by 1" (72 points) each time you click the shape in slide show view.

Sub MoveAnyShapeInSlideShow(oSh as Shape)
  With oSh
    .Left = .Left + 72
    .Top = .Top + 72
  End With
End Sub

See How do I use VBA code in PowerPoint? to learn how to use this example code.


Did this solve your problem? If so, please consider supporting the PPT FAQ with a small PayPal donation.
Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2022 Stephen Rindsberg, Rindsberg Photography, Inc. and members of the MS PowerPoint MVP team. You may link to this page but any form of unauthorized reproduction of this page's contents is expressly forbidden.

Supercharge your PPT Productivity with PPTools

content authoring & site maintenance by
Friday, the automatic faq maker (logo)
Friday - The Automatic FAQ Maker

Macros that work in Normal/Slide view don't work in Slide Show view
http://www.pptfaq.com/FAQ00159_Macros_that_work_in_Normal-Slide_view_don-t_work_in_Slide_Show_view.htm
Last update 07 June, 2011
Created: