Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trapping Error Messages

Status
Not open for further replies.

bitwise

Programmer
Mar 15, 2001
269
US
I need to check for the exist of a file using the file system object:

Dim oFileSystem, oFile, strPath
strPath = "C:\somepath"
Set oFileSystem = CreateObject("Scripting.FileSystemObject")
oFileSystem.GetFile(strPath)

Anyway, if the file does not exist you get a runtime error about the file not being found. Is there anyway to catch that error and display my own error?

Thanks,
bitwise
 
Oh, thanks. I from some unknown reason overlooked that function that did exactly what I wanted it to do and was called exactly what I would think one would call it. Weird...

Thanks,
bitwise
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top