If you are getting an out of memory error then my suspicion turns to the way you are using both early and late binding. Each time you run your code, you are launching two instances of powerpoint (PowerPointApp & ppApp), but at the end of your code, you close only one (ppApp). That seems like repetitive runs might consume memory until at some point you get your error. There is no need to do this, and you should rewrite your code to remove ppApp and rely only on PowerPointApp while remembering to close it at the end
Set PowerPointApp = CreateObject("PowerPoint.Application")
 .
 .
     Your Code Here
 .
 .
PowerPointApp.Quit
With respect to using On error:
https://docs.microsoft.com/en-us/dot...rror-statement