Coding Buttons etc

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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?
 
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.

That's all you should have to do, as long as you're running the slide in Slide
Show view. Nothing will happen when you click the button in normal or slide
or any of the other views.
 
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
 
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

BZZZZZZZZZZZZZZZZTTTTT! Sorry, Mr. Reilly, that's not the correct answer.
Vanna, tell Brian what he's lost ...

"His hair, Bill. But if he wants to try another spin of the wheel, we can play
for his mind."

Either syntax is ok, B.
 
Back
Top