troubleshooting Question

How to use VBA to return a collection of PowerPoint Custom Layout objects when more than one is selected in Master view?

Avatar of Jamie Garroch (MVP)
Jamie Garroch (MVP)Flag for United Kingdom of Great Britain and Northern Ireland asked on
VBAMicrosoft PowerPoint
2 Comments1 Solution200 ViewsLast Modified:
In PowerPoint, ActiveWindow.Selection.Type can return one of four types : None, Slides, Shapes or Text.

When in the Slide Master view and a single layout is selected in the thumbnail pane, the selection type returned is Slides and the following returns a Master object as expected:

Set obj = ActiveWindow.View.Slide
But, when more than one custom layout is selected in the thumbnail pane, the following returns an error:

Set obj = ActiveWindow.Selection.SlideRange
The error : "Selection (unknown member) : Invalid request. SlideRange cannot be constructed from a Master."

So my question is "how can I return a collection of custom layouts based on the current selection when the selection comprises more than one layout?"
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 2 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 2 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