[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Why does applying shadow to a group of PowerPoint shapes programmatically with VBA apply it to the group items?

Posted on 2016-09-09
3
Medium Priority
?
193 Views
Last Modified: 2016-09-12
I'm using PowerPoint 2016 (PC) to add two standard rectangles to a slide via the UI.

If I group them, select the groups and then add the preset shadow type type Perspective Upper Left, I get this result:

Shadow applied to a group of shapes via PowerPoint UI
If I then open the VBE and query the shadow type with:

?ActiveWindow.Selection.ShapeRange(1).Shadow.Type

Open in new window


I get 39 which equates to the enumeration constant msoShadow39

With the group selected, if I now set the shadow to none and try to apply it programatically with this:

ActiveWindow.Selection.ShapeRange(1).Shadow.Type=msoShadow39

Open in new window


I get a result which is equivalent to applying the shadow separately to each of the shapes within the group rather than the group as a whole and this is confirmed when looking at the shape properties in the PowerPoint UI:

Shadow applied to a group of shapes via PowerPoint VBA
Why is this happening?
0
Comment
Question by:Jamie Garroch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 53

Accepted Solution

by:
Rgonzo1971 earned 1000 total points
ID: 41791211
Hi,

I cannot say why but the only workaround that I see is to group the shapes, cut the group and paste it at the same position as a picture before using the shadow.

it seems that vba recognize the children and like if you were selecting the group and the individual shapes too, you would get the wrong result as well.

Regards
0
 
LVL 23

Assisted Solution

by:JSRWilson
JSRWilson earned 1000 total points
ID: 41791516
Why? Who can see into the minds of MSFT programmers. I can tell you though that it has always been that way so if it is a bug I doubt it will be fixed anytime soon.

If you copy and paste the group as an EMF you will get the first result with code (useless info)
0
 
LVL 12

Author Comment

by:Jamie Garroch
ID: 41793837
Thanks guys. FYI, I was "playing" around with a 3D automation idea and the original example above is an overly simplified extract of what I was trying to achieve to demo the issue I was facing. This video illustrates why I needed to keep the original PowerPoint shapes and not convert them:
https://www.dropbox.com/s/skw90gocd1fztwv/3D%20arc%20spiral.mp4?dl=0
Oh well, another idea in the trash thanks to buggy VBA!
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question