Introduction for those not familiar with "Exit Points". An "Exit Point" is a call to another routine for the purpose of adding functionality to routines without modifying them. "Exit Points" are useful for "Template" or "Boiler Plate" code used as the basis for another application - say - an application that reads files and generates pivottables and charts for analysis. The template often does not require modification. However, there are times when the templates needs functionality it doesn't have. At this point, the options are to modify the template or use an Exit Point.

I prefer leaving the template code - unchanged - if possible. I prefer putting special coding into areas designated specifically for exceptions. This simplifies testing and makes maintaining code simpler. So here's my question:

What is the best way to add Exit Points to VBA routines?
  1. One option is to call another routine in the standard way: MyFunction_Exit_Point_1
    The VBA compiler requires such routines exist before it attempts execution. Thus, I must also write "Shell Routines" (Empty Routines) and include them with every project - whether used or not.
  2. To avoid littering projects with unused shell routines, I can use the "RUN" statement: Run "MyFunction_Exit_Point_1". If MyFunction_Exit_Point_1does not exists, VBA throws error 1004. I can trap that error and handle it like so : IF ERR.DESCRIPTION LIKE "_Exit_Point_" THEN RESUME NEXT

I rarely use the "Run" statement and do not know the downside to the second option. If you know, please share. I also can't think of any alternatives. Does anyone else use Exit Points? If so, how are you writing them?

Thanks in advance to anyone offering insight.