BamaColtsFan
Registered User.
- Local time
- Today, 15:54
- Joined
- Nov 8, 2006
- Messages
- 91
Hey gang....
Next topic - Error Handling!
In the code below I'm trying to evaluate the value of strPath to determine if the file specified exists or not. If it doesn't, I want a message box to come up and the function to exit. Obviously, I'm not doing it right but I really have no clue how to get VB to look down the path to decide if the file is good or not. I'm pretty sure everything else will work if I can figure out how to get a true or false value for the "IF" statement...
As always, the guidance and wisdom found herein is deeply appreciated!
Next topic - Error Handling!
In the code below I'm trying to evaluate the value of strPath to determine if the file specified exists or not. If it doesn't, I want a message box to come up and the function to exit. Obviously, I'm not doing it right but I really have no clue how to get VB to look down the path to decide if the file is good or not. I'm pretty sure everything else will work if I can figure out how to get a true or false value for the "IF" statement...
Code:
If strPath IsError Then
MsgBox "The file " & strFileName & " does not exist in the path specified." & vbNewLine & vbNewLine & _
"Quitting...", vbCritical, "Please correct and try again!"
Exit Function
End If
As always, the guidance and wisdom found herein is deeply appreciated!