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

checking for a file

Status
Not open for further replies.

q4s72534

MIS
Aug 19, 2003
59
US
How do i write a script that will check to see if a file is in a certain location before I try to fetch it. thanks
 
Try this:

Code:
Sub FileExists()
dim fso
dim f as boolean
Set fso = CreateObject("Scripting.FileSystemObject")
f = fso.FileExists("C:\My Documents\File.xls")
End Sub
f will be TRUE if the file exists and FALSE if not

I hope this helps

Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top