Code in PP2007 to manipulate shapes runs slower and slower

J

James

Hi

We develop a commercial add-in for PowerPoint and have been doing so for
10 years now.

What this requires is for the slides to update dynamically and
programmatically according to live data polled from a database. This has
all been working fine up until recently. We have found that, in
PowerPoint 2007, simply refreshing a slide (ie reloading the data from
the database and redrawing the chart) takes an increasingly longer
period to do. In other words, the same code runs slower and slower - in
testing we have got this to over 15 seconds for a routine that started
out taking 0.1 seconds! This occurs both in edit mode and when running a
slideshow.

The charts are created by manipulating shapes within PowerPoint and
MSChart is not being invoked.

There is also a simple, but strange 'fix' to all this. If the user
manipulates a shape manually on the slide, or even types in a letter
into the notes pane, say, then the routine will suddenly run again at
optimum speed. However, this has to be done manually. Any programmatic
changes I make do not do this.

It is as if all the 'stack' of vba commands are being cumulatively
stored by PowerPoint (for some sort of undo??) and only is the
collection cleared when the user makes a change to the slide.

If anyone has had a similar experience or indeed has a solution to this,
I'd be very interested to hear it!

Our add-in is created in VB6 as a COM add-in.

Thanks in advance

James
 
J

James

Afraid so. In fact it already does that to avoid SlideShows running with
the slidesorter view 'on', as we found it can slow things down
incredibly. From memory each time we manipulated a shape it would redraw
the slidesorter images, including animation builds.

Good thought though! Thanks!
 
J

James

Thanks Chirag - I hadn't actually tried that, but it doesn't solve the
problem I'm afraid. I even tried switching to a different viewtype, do
the updating and then switching back, all to no avail. If I manually
move a shape, or type something in, anywhere (in a shape or the Notes
Pane), then I get back to optimum speed.

I'll have a go at creating something similar in a simple vba project
that can be posted here, although I'm not too sure if it'll 'work'.

Cheers
 
J

James

Yep it works. Here's a link to an example file with a simple macro in
it. All it does is move each shape up and down one pixel and times the
whole process. By repeatedly running the macro, it soon starts to slow
down. To reset it back to its optimum speed, simply move something or
type something into the Notes Pane. You can either run the macro from
the vba editor window or from the slideshow using the helpful button
I've put on the slide...

I'd be very interested to here if anyone gets similar results to me, or
indeed if they don't and it doesn't slow down at all, ever. Either
result would be welcome news!

http://www.buckhurst.info/TimerTest.pptm

Thanks in advance.

James
 
C

Chirag

Hi James,

Bad I am able to reproduce the issue.
Good A workaround is to get rid of the VBA CommandButton and use
PowerPoint shape on the slide and assign "Run macro" action to the shape. I
did that and now the macro doesn't slow down the updates.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
J

James

Many thanks for checking this out for me. I think the reason it doesn't
slow down when you click on a PowerPoint shape is because you are
manually interfacing at some level with the slide and that is what sorts
the problem out. Having said that, interestingly enough, if I don't use
the shape to run the macro but just play a sound, then it doesn't cure
the problem. Does it slow down in the Edit Window with no slideshow running?

In any case a) I need this to be a code-driven process without the need
for user interaction and b) having the mouse on-screen during a
slideshow is not an option.

The example I have posted here is a very simplified version of what our
dll does, but I'm glad to see that the problem can be reproduced without
mountains of code. Unfortunately it also means it's not my fault that
it's happening and therefore it's most likely not in my control to be
able to fix it.

Thanks Chirag

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top