I have a slide with a shape set to run the following code (below) which
toggles the visibility of another shape and toggles a document tag.
Everything works as expected, but the update takes about 0.5 seconds (on a
Centrino Duo 1.66 GHz).
I believe the slow execution has to do with the number of other shapes on
the slide (about 70). If I create a new first slide and copy the over to it,
it runs almost instantaneously. If I then add several shapes to that new
slide, it again runs slowly. I've tried referencing the object directly
(.Slides(1).Shapes(56).Fill.Visible = msoTrue), but that doesn't seem to
change anything. Does anyone know if there is a better way for me to be
referencing shapes or changing properties to speed things up?
Thanks so much!
Kevin
'''''''''''''''''''''''''
Sub ToggleShow1()
On Error GoTo OnError
With ActivePresentation
Select Case .Tags("Show1")
Case "False"
.Tags.Add "Show1", "True"
.Slides(1).Shapes("Check1").Fill.Visible = msoTrue
Case Else
.Tags.Add "Show1", "False"
.Slides(1).Shapes("Check1").Fill.Visible = msoFalse
End Select
End With
NoErrors:
Exit Sub
OnError:
End Sub
''''''''''''''''''''''''''''''
I'm not sure this would run much faster but could you not do away with the
tegs and use this to toggle
With ActivePresentation.Slides(1).Shapes("Check1")
.Fill.Visible = Not .Fill.Visible
End With
--
-------------------------------------------
Amazing PPT Hints, Tips and Tutorials
http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
You might try naming the shapes instead of using a number. When you use the
number the code has to count (enumerate) each shape on the slide (to make
certain there are 56 of them (or whatever number your after.) I've found
executing code on a named shape is almost instant.
Austin Myers
Microsoft PowerPoint MVP Team
Creator of PFCPro, PFCMedia and PFCExpress
http://www.playsforcertain.com
"Kevin Dufendach" <Kevin Dufe...@discussions.microsoft.com> wrote in
message news:AF01FE19-84AE-4C56...@microsoft.com...
I suspect the time lag is PowerPoint redrawing the slide (and the 70
objects). Try ticking hardware accelleration in Slide Show > Set up show.
Does that help at all?
--
-------------------------------------------
Amazing PPT Hints, Tips and Tutorials
http://skp.mvps.org/ppttimeline1.htm
--
David M. Marcovitz
Microsoft PowerPoint MVP
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Kevin Dufendach <krd.p...@gmail.com> wrote in news:f750dcde-8baa-4324-
99b6-bf9...@d1g2000hsg.googlegroups.com:
Is this code running in slide show mode or design mode?
Regards,
Shyam Pillai
Image Importer Wizard
http://skp.mvps.org/iiw.htm
"Kevin Dufendach" <krd.p...@gmail.com> wrote in message
news:6b05d2cc-65f1-4f8c...@t54g2000hsg.googlegroups.com...
I'm sorry to hear that you can't control trigger sequences (at least,
not easily). I'm running this in slide show mode. Basically, this is
a checkbox that sets an option that the rest of the presentation will
reference. e.g.:
-----------------------------------------------------------
| |
| |
| Whales |
| by Kevin Dufendach |
| |
| |
| [X] go to random [ Go! ] |
-----------------------------------------------------------
When the user checks the "Go to random" checkbox, then every time
[ Go! ] is pressed, a random slide is brought up. When it's not
checked, then the [ Go! ] button just goes to the next slide (the
[ Go! ] button is part of the master, so it's repeated on every
slide). The program should also remember what the state of the
checkbox is so that the next time the presentation is run, it will
remember the user's preference and have that automatically set.
Thanks, all, for your suggestions.