Hi,
I have some code below that takes a range in Excel and copies it as a picture into Powerpoint. The bottom section of the code sizes and positions the picture on the ppt slide. How can I change the code so the value of 0.75 that is currently hard-written into the code as '.ScaleHeight 0.75, msoTrue' is taken from cell H14 in the worksheet. The value in H14 will change.
Hope you can help, many thanks.
Dim Shp As Object
Dim sld As Object
Dim eff As Object
Const msoAnimEffectFade As Long = 10
Const msoAnimTriggerWithPrevious As Long = 2
Set PPApp = GetObject(, "Powerpoint.Application")
Set PPPres = PPApp.ActivePresentation
Range("G20:O20").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Set sld = PPPres.Slides("Yourself")
Set Shp = sld.Shapes.Paste.Item(1)
Set eff = sld.TimeLine.MainSequence.AddEffect _
(Shape:=Shp, effectid:=msoAnimEffectFade, Trigger:=msoAnimTriggerWithPrevious) 'effect details
eff.Timing.Duration = 0.5
eff.Timing.TriggerDelayTime = 0
With Shp
.LockAspectRatio = msoTrue
.ScaleHeight 0.75, msoTrue
.Left = 21
.Top = 116
.ZOrder msoSendToBack
End With
End Sub
I have some code below that takes a range in Excel and copies it as a picture into Powerpoint. The bottom section of the code sizes and positions the picture on the ppt slide. How can I change the code so the value of 0.75 that is currently hard-written into the code as '.ScaleHeight 0.75, msoTrue' is taken from cell H14 in the worksheet. The value in H14 will change.
Hope you can help, many thanks.
Dim Shp As Object
Dim sld As Object
Dim eff As Object
Const msoAnimEffectFade As Long = 10
Const msoAnimTriggerWithPrevious As Long = 2
Set PPApp = GetObject(, "Powerpoint.Application")
Set PPPres = PPApp.ActivePresentation
Range("G20:O20").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Set sld = PPPres.Slides("Yourself")
Set Shp = sld.Shapes.Paste.Item(1)
Set eff = sld.TimeLine.MainSequence.AddEffect _
(Shape:=Shp, effectid:=msoAnimEffectFade, Trigger:=msoAnimTriggerWithPrevious) 'effect details
eff.Timing.Duration = 0.5
eff.Timing.TriggerDelayTime = 0
With Shp
.LockAspectRatio = msoTrue
.ScaleHeight 0.75, msoTrue
.Left = 21
.Top = 116
.ZOrder msoSendToBack
End With
End Sub