Add a Picture Style to a Selected picture in VBA

Chris Macro

Well-known Member
Joined
Nov 2, 2011
Messages
1,345
Office Version
  1. 365
Platform
  1. Windows
I've been trying to research this one with no luck. Is there any way in VBA that you can use the Office 2007 preset pictures styles on a picture? I specifically want to use the one called "Drop Shadow Rectangle".
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Well that's a bummer. Ok so I am trying to make my own drop shadow that is similar to the preset. However the settings I am inputting are not seeming to apply to my targeted picture the way I want them.

I want my shadow to look like:
Transparency: 35%
Size: 100%
Blur: 9pt
Angle: 45
Distance: 9pt

But when I run my code it gives me these settings:
Transparency: 0%
Size: 100%
Blur: 5pt
Angle: 45
Distance: 2.9pt

Code:
<font face=Calibri><SPAN style="color:#007F00">'GRAPH TWO</SPAN><br><br><SPAN style="color:#00007F">Set</SPAN> slide = pwr_app.ActivePresentation.Slides(2)<br><br><SPAN style="color:#007F00">'Copy Graph Range in Excel</SPAN><br>    Sheet5.Range("X25:AJ48").Copy<br>    <br><SPAN style="color:#007F00">'Paste into Powerpoint and resize</SPAN><br>    <SPAN style="color:#00007F">Set</SPAN> ShapeRange = slide.Shapes.PasteSpecial(1)  <SPAN style="color:#007F00">'1 = Bitmap Paste (microsoft constant #)</SPAN><br>        ShapeRange.Left = 328<br>        ShapeRange.Top = 18<br>        ShapeRange.Height = 132<br>        ShapeRange.Width = 217<br>        ShapeRange.Name = "Graph2"<br>        <br>     <SPAN style="color:#007F00">'Format Picture</SPAN><br>     <SPAN style="color:#00007F">With</SPAN> ShapeRange.Shadow<br>        .ForeColor.RGB = RGB(0, 0, 0)<br>        .Blur = 4<br>        .Transparency = 0.6<br>        .OffsetX = 5<br>        .OffsetY = -3<br>        .Visible = <SPAN style="color:#00007F">True</SPAN><br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN></FONT>
 
Upvote 0

Forum statistics

Threads
1,215,639
Messages
6,125,970
Members
449,276
Latest member
surendra75

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top