troubleshooting Question

PowerPoint 2016 VBA - selecting a shape problem

Avatar of hindersaliva
hindersalivaFlag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft PowerPointVBA
3 Comments1 Solution258 ViewsLast Modified:
My presentation has 10 slides. The shape "Note 85" is on Slide 2. The following code I thought would look for the shape on any of the slides. Strangely, it seems to only look at the shapes in Slide 1. But I can't see why!!!
Can somebody see what I'm missing please?
Thanks.

Note: if "Note 85" is on Slide 1 it finds it.

strShapeToSelect = "Note 85"

For Each sld In ActivePresentation.Slides

    Set shp = sld.Shapes(strShapeToSelect)

    If Not IsEmpty(shp) Then
        shp.Fill.ForeColor.RGB = RGB(255, 0, 0)
                                    
        Exit For
    End If
Next
ASKER CERTIFIED SOLUTION
John Wilson
CEO PowerPoint Alchemy

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros