Powerpoint VBA , no default error checking.

D

dougsdir

Im dabbling in vba using Powerpoint for the first time but i noticed that when error error occurs on my code nothing happens.

To make this as simple as possible to explain i'll give an example

If i create a new powerpoint presentation and only slide 1 i add a button shaped Shape.
I then Alt+F11 to go to VBA code and insert a new module
I add the following code

Sub Test()
msgbox "Hello"
End Sub

I then assign this macro to the Shape.
I then fire up the presentation and click the button Shape and up pops the message "Hello", so that is all ok

If i go back to the code and amend the code to the following:

Sub Test()

msgbox12345 "Hello"
End Sub

and then try to clikc the Shape again I would expect it to error as there is no command msgbox 12345 but instead of an error , nothing happens.
 
D

dougsdir

even if i change the code to

Sub Test()
msgbox "Hello"
msgbox12345 "Hello"
End Sub

I would expect the first line of the code to run but again nothing happens.

When i replicate the exact same code in Excel i get the error:

Compile error:

Sub or Function not defined.

is there something i need to do in Powerpoint to get my code to compile properly?
 

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