To run a macro when the Retreat event occurs, set the OnRetreat property to the name of the macro.
You can’t use the CancelEvent action in a Retreat macro.
Retreat Event — Event Procedures.