vba to assign animation to a picture transferred into powerpoint

cjcass

Well-known Member
Joined
Oct 27, 2011
Messages
683
Office Version
  1. 2016
Platform
  1. Windows
Hi,
I have the following vba that copy>pastes a worksheet range from excel into ppt as a picture. What code will then assign a Fade In animation to the picture?
Hope you can help, many thanks.
Code:
Set PPApp = GetObject(, "Powerpoint.Application")
Set PPPres = PPApp.ActivePresentation


Sheet72.Range("G15:S37").CopyPicture Appearance:=xlScreen, Format:=xlPicture
PPPres.Slides(1).Shapes.Paste


With PPPres.Slides(1)
    With .Shapes(.Shapes.Count)
        .LockAspectRatio = msoTrue
        .ScaleHeight 0.8, msoTrue
        .Left = 27
        .Top = 121
    End With
End With
 
Last edited by a moderator:
Hi RoryA,

this is an old thread but been very helpful to me.

I have been trying to do something similar to your code and mostly it is working but i have one additional request.

the trigger for this animation is by a click on another image but this gives me aruntime error 438-

the code is as follows -

'Store Slide's "Correct Answer" Shape to a variable
Set ppt_shp = .Shapes("Choice_" & Answer)
Set ppt_answer = .Shapes("FinalAnswer")
Set ppt_eff = .TimeLine.MainSequence.AddEffect( _
Shape:=ppt_shp, EffectId:=54, Level:=msoAnimateLevelNone, trigger:=msoAnimTriggerOnShapeClick) '54 = msoAnimEffectChangeFillColor

ppt_eff.EffectParameters.Color2.RGB = RGB(112, 173, 71)

With ppt_eff.Timing
.Duration = 0.4
.triggershape = .Shapes("FinalAnswer") 'error -- Runtime error 438 Object doesnt support this property or method
End With

any suggestions would be great.

Thank you

Regards
Kunal
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,223,248
Messages
6,171,011
Members
452,374
Latest member
keccles

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