Start an exe within your app w/ error handling!

By | 2002-06-01

starts an exe from within your application

Original Author: Daniel Errante

Code

Sub LoadEXE(Dir As String)
On Error GoTo err:
X% = Shell(Dir, 1): NoFreeze% = DoEvents(): Exit Sub
Exit Sub
err:
'make your own error messages like mine below, or use the default:
If err.Number = 6 Then Exit Sub
MsgBox "Please make sure that the application you are trying to launch is located in the correct folder." & vbCrLf & "If not, do this and retry launching the application.", vbExclamation
'default: MsgBox "Error:" & vbCrLf & err.Description & vbCrLf & err.Number, vbExclamation

End Sub

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.