.shapes().visible=True works in 2003 but not in 2007

  • Thread starter Thread starter Gadgetprog
  • Start date Start date
G

Gadgetprog

I'm working on a school project and the slide show works fine in version 2003
which is what is was developed in. However when running in version 2007 some
of the .shapes().visible =True code doesnt work when the slideshow is running.

If I execute the macro manually in version 2007 while in "normal view" the
screen updates properly. Very strange.... Any ideas? Below are a few code
examples from the program which you can see is nothing fancy. I can supply
you with the file if requested. I really need this to work with 2007...

The first code below just hides all the answers to get started. It basically
initializes the slide when the slide show is launched.

'Hides answers and points on Q1 Slide (Question #1 slide #3)
ActivePresentation.Slides(3).Shapes("X1-1").Visible = False
ActivePresentation.Slides(3).Shapes("X1-2").Visible = False
ActivePresentation.Slides(3).Shapes("X1-3").Visible = False
ActivePresentation.Slides(3).Shapes("Q1-1").Visible = False
ActivePresentation.Slides(3).Shapes("P1-1").Visible = False
ActivePresentation.Slides(3).Shapes("Q1-2").Visible = False
ActivePresentation.Slides(3).Shapes("P1-2").Visible = False
ActivePresentation.Slides(3).Shapes("Q1-3").Visible = False
ActivePresentation.Slides(3).Shapes("P1-3").Visible = False
ActivePresentation.Slides(3).Shapes("Q1-4").Visible = False
ActivePresentation.Slides(3).Shapes("P1-4").Visible = False
ActivePresentation.Slides(3).Shapes("Q1-5").Visible = False
ActivePresentation.Slides(3).Shapes("P1-5").Visible = False
ActivePresentation.Slides(3).Shapes("H1-1").Visible = False

On slide 3 I have a button tha has a hyperlink tha calls "Correct_1" macro
which has the following code.

Sub Correct1_1()
ActivePresentation.Slides(3).Shapes("Q1-1").Visible = True
ActivePresentation.Slides(3).Shapes("P1-1").Visible = True
End Sub

The problem is shape "P1-1" shows up fine but shape "Q1-1" does not.... only
when the presentation is running. Seems all the point values will show up but
none of the answers.

All works fine in 2003 and in normal mode of 2007. I've tried everything I
know. Been working on it for days and now I only have two days left before it
is due.

Any help will be greatly appreciated. Thank you in advance!
 
Works for me but I have seen this before. Do you have other normal animations
on the slide? Animation and .visible don't seem to mix well.

If not you might try refreshing the slide using this:
SlideShowWindows(1).View.GotoSlide (SlideShowWindows(1).View.Slide.SlideIndex)
'note this code should be on one line
 
What John said and...

I have been seeing this more and more in 2007. The best workaround that I
have come up with is to set the .Top off the viewable portion of the slide,
instead of the .Visible = False. The drawback of this is that you then can't
simply set the .Visible = True to make it show up again; you have to set the
..Top to the correct location. For example:

ActivePresentation.Slides(3).Shapes("X1-1").Top = 3000

will consistently hide the shape.

Sometimes the things that John suggested will work but not consistently. The
animation problems that John mentioned have always been a problem so using
..Visible with animations will sometimes not work as well, but that is not
likely to be your problem.

--David

I'm working on a school project and the slide show works fine in version 2003
which is what is was developed in. However when running in version 2007 some
of the .shapes().visible =True code doesnt work when the slideshow is running.

If I execute the macro manually in version 2007 while in "normal view" the
screen updates properly. Very strange.... Any ideas? Below are a few code
examples from the program which you can see is nothing fancy. I can supply
you with the file if requested. I really need this to work with 2007...

The first code below just hides all the answers to get started. It basically
initializes the slide when the slide show is launched.

'Hides answers and points on Q1 Slide (Question #1 slide #3)
ActivePresentation.Slides(3).Shapes("X1-1").Visible = False
ActivePresentation.Slides(3).Shapes("X1-2").Visible = False
ActivePresentation.Slides(3).Shapes("X1-3").Visible = False
ActivePresentation.Slides(3).Shapes("Q1-1").Visible = False
ActivePresentation.Slides(3).Shapes("P1-1").Visible = False
ActivePresentation.Slides(3).Shapes("Q1-2").Visible = False
ActivePresentation.Slides(3).Shapes("P1-2").Visible = False
ActivePresentation.Slides(3).Shapes("Q1-3").Visible = False
ActivePresentation.Slides(3).Shapes("P1-3").Visible = False
ActivePresentation.Slides(3).Shapes("Q1-4").Visible = False
ActivePresentation.Slides(3).Shapes("P1-4").Visible = False
ActivePresentation.Slides(3).Shapes("Q1-5").Visible = False
ActivePresentation.Slides(3).Shapes("P1-5").Visible = False
ActivePresentation.Slides(3).Shapes("H1-1").Visible = False

On slide 3 I have a button tha has a hyperlink tha calls "Correct_1" macro
which has the following code.

Sub Correct1_1()
ActivePresentation.Slides(3).Shapes("Q1-1").Visible = True
ActivePresentation.Slides(3).Shapes("P1-1").Visible = True
End Sub

The problem is shape "P1-1" shows up fine but shape "Q1-1" does not.... only
when the presentation is running. Seems all the point values will show up but
none of the answers.

All works fine in 2003 and in normal mode of 2007. I've tried everything I
know. Been working on it for days and now I only have two days left before it
is due.

Any help will be greatly appreciated. Thank you in advance!

--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
Thanks for the help!

One animation at the top of each slide... blinds... upon opening the slide
it call the following code to delay the
Sub HtoH_Q1()
ActivePresentation.Slides(3).Shapes("H1-1").Visible = True
DoEvents
Sleep (2000)
ActivePresentation.Slides(3).Shapes("H1-1").Visible = False
End Sub

I also did try refreshing the screen after the .shapes().visible=True code
but no luck. Maybe the trick here is to remove tha animation and see if it
works.

Thanks again
 
Thanks David!

I'm going to try using the .Top command with the shapes left visible from
the the start and see if that works. It's a great alternate idea.... although
IMHO the issue with the code not working in 2007 should have been addressed
by MS a long time ago.... :(

Thanks again for the help.
 
I wholeheartedly agree about the MS needing to fix this. I wasted many hours
with my class this summer because of this very problem. You mentioned in
your response to John that you had some animation on the slides. I'd try
removing that first before trying the .Top thing. The interference of
animation with .Visible is another problem that I would have hoped MS would
have fixed long ago. That cost me a lot of time when I taught my VBA class
last year.
--David

Thanks David!

I'm going to try using the .Top command with the shapes left visible from
the the start and see if that works. It's a great alternate idea.... although
IMHO the issue with the code not working in 2007 should have been addressed
by MS a long time ago.... :(

Thanks again for the help.

--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
Back
Top