|
-
Oct 13th, 2004, 08:08 AM
#1
Thread Starter
Junior Member
Run Time Error?
how to avoid crashing the program and resuming back when i get message RunTimError File not Found ?
When i get this error i want it to display: Msgbox"File Not Found",vbinformation
is it possibile!?
-
Oct 13th, 2004, 08:13 AM
#2
PowerPoster
In your code you could start with :
On Error go to errorcode
then at the bottom put an
Exit Sub
followed by
errorcode:
MsgBox "An error occurred: [" & Err.Number & "] " & Err.Description & " - Source: " & Err.Source
-
Oct 13th, 2004, 08:13 AM
#3
Banned
VB Code:
Public Function pFunction() As Boolean
On Error GoTo Err:
1 Let pFunction = True
2 Exit Function
Err:
Call Err.Raise(Err.Number, Err.Source, Err.Description & vbNewLine & "pFunction:" & Erl, Err.HelpFile, Err.HelpContext)
End Function
be sure to number the lines
-
Oct 13th, 2004, 08:53 AM
#4
Re: Run Time Error?
Originally posted by theCro
how to avoid crashing the program and resuming back when i get message RunTimError File not Found ?
When i get this error i want it to display: Msgbox"File Not Found",vbinformation
is it possibile!?
You may simply check if file exist right before you open it:
VB Code:
If Not Dir("full_file_path_plus_name", vbNormal) = "" Then
'open file here
End If
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
|