I have several command buttons that I use to open other programs using the shell command.

One of them is a DOS program. If when the user is done with it they close with the exit command within the program it closes OK. If they use the close button they get an error message and then the program closes.

I'd like to trap this error message or just turn it off. It's confusing. Can this be done?

THanks in advance