Something simple is so hard! Macro trouble

S

shanona

Ok, here's what I'm trying to do...have 5 buttons on the slide. When
go to slideshow mode, be able to click on any of the buttons and tha
button disappear. I know I have to use a Macro.....I am using th
following command:

Sub hide()

ActiveWindow.Selection.SlideRange.Shapes("AutoShape 11").Visible
False

End Sub

I hyperlinked that Action Button to run the macro when I click it.
When I go into slideshow mode, and click on the button, nothin
happens, except the button depressing. When I run the macro in regula
mode, it disappears, and I have to change the macro, and run it again t
get it to reappear. I know little to nothing about Macros, but woul
love to learn! Can anyone help
 
B

Bill Dilworth

But in a slideshow you are not selecting the shape, that only happens in
edit view.

Try this instead:

Sub Kiaser_Sosa(oShp As Shape)
oShp.Visible = False
End Sub

When the shape is clicked on, it becomes the object oShp.


--

Bill Dilworth
Microsoft PPT MVP Team
Users helping fellow users.
===============
Please spend a few minutes checking vestprog2@
out www.pptfaq.com This link will yahoo.
answer most of our questions, before com
you think to ask them.

Change org to com to defuse anti-spam,
ant-virus, anti-nuisance misdirection.
..
..
 
D

David M. Marcovitz

What Bill and Sonia said and:

The trouble you are having is that you are working in Slide Show mode and
nothing can be selected. So when you say ActiveWindow.Selected, you come up
empty because nothing is selected.

Instead, you can do:

ActivePresentation.SlideShowWindow.View.Slide.Shapes("AutoShape 11").Visible
= False

Of course, you won't need to do that if you use Bill's suggestion. In fact,
Bill's suggestion works for every button, so none of the buttons need their
own procedure. The difficulty is that at some point you will want to unhide
the buttons. For that, you'll need:

ActivePresentation.SlideShowWindow.View.Slide.Shapes("AutoShape 11").Visible
= True

if you are clicking a button on the current slide or:

ActivePresentation.Slides(#).Shapes("AutoShape 11").Visible = True

if you are clicking a button on another slide (replace # with an actual
slide number).

--David

David Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 

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