|
-
Nov 21st, 1999, 01:18 AM
#1
Thread Starter
New Member
Hello, I am starting to understand the shell function, but the error from the shell is the thing I don't get.
I have this
----code----
dim path as string
path = text1.text
shell (path)
----code----
Pretty easy, I have text1 the path. The USER locates the path from a Commondialog.
But sometimes the path isn't found and an error comes up from the shell.
How do I cancle this error and continue on to a diffrent action.
An action like,
If shell(path) = false then
do action here
msgbox ("Path not found please try locating it again")
something like that.
Please help, thank you
-
Nov 21st, 1999, 01:23 AM
#2
Guru
Try this:
On Error Resume Next
If Len(Trim(Text1.Text)) = 0 Or Len(Dir(Text1.Text)) = 0 Then
Call MsgBox("Error: " & Text1.Text & " - Path doesn't exist.", vbCritical, "Path Doesn't Exist")
Else
Call Shell(Text1.Text, vbNormalFocus)
If Err.Number <> 0 Then
Call MsgBox("Error #" & Err.Number & ": " & Err.Description, vbCritical, "Runtime Error")
End If
End If
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879
AIM: RYoni69
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|