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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with searching a file 1

Status
Not open for further replies.

villica

Programmer
Feb 25, 2000
332
CA
I am trying to search a file and eventhoug the file is on a network drive it always comes up with not found message

dim response as long
dim fs as long

Set fs = CreateObject("Scripting.FileSystemObject")
file = "OPENORDER" & Format(DATE - 3, "mmddyy") & ".XLS" ' change to match the file w/Path
MsgBox file
response = fs.FileExists(file)
If response = -1 Then
msgbox "File found"
else
msgbox "file not found"
end if

villica
 
What does the MsgBox display when you run it? Are you providing the complete path or just a file name?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
thanks TomThumKP, I forgot to give the complete path.


villica
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top