Coding Buttons etc

N

Neil

I cannot seem to get any code associated with buttons to work. This is the first time I have tried anything in Powerpoint. I have experience in coding in Excel. Something as simple as adding a CommandButton to a slide then adding the code, HelloMsg = MsgBox("Hello", vbOkOnly) then running the slide does nothing when the button is clicked. I have copied some stuff out of the help and still to no avail. What needs to be done

Thanks in advance.
 
G

Glen Millar

Hi,

It could be the fact that vba behaves differently in slideshow mode:

http://www.rdpslides.com/pptfaq/FAQ00159.htm

--
Regards,

Glen Millar
Microsoft PPT MVP
http://www.powerpointworkbench.com/
Please tell us your ppt version, and get back to us here
Posted to news://msnews.microsoft.com

Neil said:
I cannot seem to get any code associated with buttons to work. This is the
first time I have tried anything in Powerpoint. I have experience in coding
in Excel. Something as simple as adding a CommandButton to a slide then
adding the code, HelloMsg = MsgBox("Hello", vbOkOnly) then running the slide
does nothing when the button is clicked. I have copied some stuff out of the
help and still to no avail. What needs to be done?
 
B

Brian Reilly, MS MVP

Neil,
Your posted code is only setting the value of the variable and not
calling the msgbox itself.

Add a Command button and double click it to see the VBE for the code
and add the contents of this to it

Private Sub CommandButton1_Click()
MsgBox "Hello Neil, I work this way."
End Sub

Brian Reilly, PowerPoint MVP
 

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