hindersaliva
asked on
PowerPoint 2016 VBA - selecting a shape problem
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Oh yes. It's jumping out before looking at the next slide. (like you said JRSW!)
Thanks. I'll close this question.
Thanks. I'll close this question.
ASKER
But sorry, in my question I foolishly took out a few lines of code to simplify and confused the issue :(
Yes there is an 'On Error Resume Next' in my code. So I'm still not sure why mine only looked at Slide 1.
The full code is
Open in new window
Just curious. Not essential to my project.