Avatar of Jamie Garroch (MVP)
Jamie Garroch (MVP)
Flag for United Kingdom of Great Britain and Northern Ireland asked on

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

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

Open in new window

But, when more than one custom layout is selected in the thumbnail pane, the following returns an error:

Set obj = ActiveWindow.Selection.SlideRange

Open in new window

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?"
VBAMicrosoft PowerPoint

Avatar of undefined
Last Comment
Jamie Garroch (MVP)

8/22/2022 - Mon
John Wilson

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jamie Garroch (MVP)

On further searching, I discovered we discussed this before on the Microsoft Answers forum, albeit in a slightly different context. I was hoping that things had changed but alas no! And yes, I know you don't say "it's not possible" lightly. Thanks John :-)
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy