arthurh88
asked on
How can I paste a single image in a powerpoint slide many times via a macro?
I'm trying to create a cute slide with an animation that shows an image (i.e. a cartoon virus), "multiplying" dozens of times, all over the slide.
So I created a Macro which calls VBA code on SlideShowNextSlide. I verify the slide is the right number, and I use this code to copy and paste an object multiple times:
The code works just fine, however, the images all "appear at once" and I'd like to see them appear 1 at a time, albeit very very fast. When I use a timer code such as
it doesn't work well at all. The results look terrible. Chunks of items get pasted...then a delay, then more chunks. Nothing is smooth. I'd like to have my images pasted with even intervals of a couple of miliseconds. Is this possible?
So I created a Macro which calls VBA code on SlideShowNextSlide. I verify the slide is the right number, and I use this code to copy and paste an object multiple times:
With ActivePresentation
For Count = 1 To 40
randomX = Int(850 * Rnd(1)) - 30
RandomY = Int(500 * Rnd(1)) - 20
RandomRotation = Int(360 * Rnd(1)) + 1
ActivePresentation.Slides(9).Shapes(1).Copy
Set myrange = ActivePresentation.Slides(9).Shapes.Paste
myrange.Left = randomX
myrange.Top = RandomY
myrange.Rotation = RandomRotation
end with
The code works just fine, however, the images all "appear at once" and I'd like to see them appear 1 at a time, albeit very very fast. When I use a timer code such as
Start = Timer
Do While Timer < Start + 0.1
DoEvents
Loop
it doesn't work well at all. The results look terrible. Chunks of items get pasted...then a delay, then more chunks. Nothing is smooth. I'd like to have my images pasted with even intervals of a couple of miliseconds. Is this possible?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER