Hopefully a very simple answer.
I want a certain macro to stop after it has processed all files. That means that it is still running after the last document has closed. With swApp.Exitapp Solidworks itself stops... But I only want the macro to quit and see the empty start screen of solidworks.
Exit sub results in a loop.