Powerpoint VBA , no default error checking.

  • Thread starter Thread starter dougsdir
  • Start date Start date
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.
 
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?
 
Back
Top