You shouldnt use End, ever, its not recommended as it doesnt clean up anything, it only shuts down the program.
If you form doesnt even get shown then what about not having the form at all and using Sub Main to execute the code and then it will exit automatically when the code in Main is done.