I am using VBA to make a PowerPoint presentation based on data in an Access query. I am having issues with adding a picture to the presentation. I have the following bit of code which works to add the picture as long as it is right at the beginning of the code (ie. the last powerpoint slide):
But if I try and put it anywhere else in the code the picture is added fine but the code stops running and I get 'Run-time error '-2147188169 (80048240) Method 'Select' of object 'Shape' failed' with the error on the Shapes.AddPicture... line.
Any ideas on how to fix this?
Code:
With .Slides.Add(rs.AbsolutePosition + 1, ppLayoutBlank)
.FollowMasterBackground = False
.Background.Fill.Solid
.Background.Fill.ForeColor.RGB = RGB(255, 255, 255)
.SlideShowTransition.EntryEffect = ppEffectFade
.Shapes.AddPicture(FileName:="D:\Desktop\JDJ\ECC\PowerPoints\ECClogo.jpg", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=168, Top:=134, Width:=592, Height:=191).Select
End With
But if I try and put it anywhere else in the code the picture is added fine but the code stops running and I get 'Run-time error '-2147188169 (80048240) Method 'Select' of object 'Shape' failed' with the error on the Shapes.AddPicture... line.
Any ideas on how to fix this?