VBA Problem Hiding and Showing Shapes

D

David M. Marcovitz

I am working with someone who is having a problem, and I can't figure it
out. She is trying to do something fairly simple. I am looking at the
presentation in Windows XP, PowerPoint 2002. Early in the presentation,
she hides some shapes. For example:

ActivePresentation.Slides(9).Shapes("Q1Button").Visible = False
ActivePresentation.Slides(9).Shapes("Q1TextBox").Visible = False

Later in the presentation, while looking at slide 9, she shows the
shapes:

ActivePresentation.Slides(9).Shapes("Q1Button").Visible = True
ActivePresentation.Slides(9).Shapes("Q1TextBox").Visible = True

The problem is that the shapes don't show up until after exiting the
slide show. The screen does not seem to be refreshing. I tried a few
things. I tried going to the slide:

ActivePresentation.SlideShowWindow.View.GotoSlide 9

but that did not refresh the slide. Then, I added some shapes. When I
added a shape on the slide and hid it along with the other two shapes,
the two orignal shapes showed up and the added shape showed up but part
of it was cut off. Then I deleted the additional shape and added a small
shape off the slide and that worked perfectly. I did this for all the
slides, and they all seem to work fine now, but it doesn't instill much
confidence in me because I can't explain it.

As a final thing, I tried deleting the shapes and adding new ones with
the same name, but that did not help, so I went back to the small added
shape solution.

Is tehre something else we should be doing to refresh the screen
properly? Or is there a logical explanation for this behavior?

Thanks for your help.

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
S

Steve Rindsberg

Possibly a borderline corrupt PPT file?

Try roundtripping it to HTML and back.
 
B

Bill Foley

I haven't heard of any Video problem preventing objects from showing up.
There must be something else in the code that is messed up. I know you can
click a button on a slide that runs code to show an object on the same slide
while you are viewing it. I do it all the time!

I am sure you know more about this stuff than I do, but maybe a separate
look might help. I would need to see the big picture to see if I can come
up with anything. If you want, you can send the code (or file - zipped) to:

wfoley1 at txu dot com

or

info at pttinc dot com
 
B

Bill Foley

Did you send it to both addresses? Sometimes the top one requires a lot of
"let's check this thing out before we allow it through our firewall".
 
D

David M. Marcovitz

Thanks to Bill Foley for locating the problem. I'm going to call it a
bug in PowerPoint. The answer is that animated GIFs and hiding and
showing shapes don't mix. The slides that were having problems had
animated GIFs on them. Once the animated GIFs were removed, everything
worked fine. I had seen this problem a couple of years ago, but I forgot
about it until Bill mentioned it.

I'd like to nominate Bill for MVP. Oh wait, he arleady is.

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
B

Bill Foley

If you put a chair in the hallway, turn off the lights, then walk back and
forth enough, you'll trip over it eventually. Glad to help!
 
T

TAJ Simmons

David....
......Oh wait, he ** arleady ** is.....

Is this what they call a southern drawl ?

TAJ :)
 
S

Steve Rindsberg

David M. said:
Thanks. Round-tripping didn't work. Any other ideas?
--David

In case it's video weirdness, try it with hardware accel. turned way back.

I'd also try replacing the shapes and giving them new names altogether, modify
the code to reflect the new names. If there are two shapes, one whose "real"
name is the same as the .Name property of another shape, things get muddled.

Is there any other substantial amount of code involved, or just what you've
indicated, pretty much?
 
S

Steve Rindsberg

Is the GIF eating up all the processor/display time and keeping the slide from
refreshing? Something like that?

Weird! Thanks for reporting it and thanks to Bill for whacking it so quickly.
 
B

Bill Foley

SSSSSSSSSSSSShhhhhhhhhhhhhhheeeeeeeeeeeeeeeeeeiiiiiiiiiiiiiiiiiiiiiiiiit!
Now that's a "drawl"
 

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