Mar 2, 2001 #1 bujin MIS Joined Oct 2, 2000 Messages 144 Location GB Is there such a thing? If not, how do I find out if a file exists using Visual Basic for Applications (in Excel)?
Is there such a thing? If not, how do I find out if a file exists using Visual Basic for Applications (in Excel)?
Mar 2, 2001 Thread starter #2 bujin MIS Joined Oct 2, 2000 Messages 144 Location GB Never mind, I got it! I was thinking of Delphi (I think). Just use the Dir() command. Upvote 0 Downvote
Mar 2, 2001 #3 Guest_imported New member Joined Jan 1, 1970 Messages 0 You can also use Application.FileSearch, it depends which one you think is easier. Upvote 0 Downvote
Mar 2, 2001 Thread starter #4 bujin MIS Joined Oct 2, 2000 Messages 144 Location GB Well would you look at that! That's simplified the task ten-fold! Thx Dark_Sun! Upvote 0 Downvote
Mar 2, 2001 #5 Psychpt MIS Joined Dec 4, 2000 Messages 147 Location US Dir is the vb way to test if a file or directory exists. HTH Upvote 0 Downvote
Mar 2, 2001 1 #6 JWhyte Programmer Joined Feb 8, 1999 Messages 25 Location GB Or use Scripting.FileSystemObject. i.e. Code: Dim FSO As FileSystemObject Set FSO = New FileSystemObject If FSO.FileExists("<path to file") Then ' Code on existence of file. End If HTH John Whyte jwhyte@skipton.co.uk Upvote 0 Downvote
Or use Scripting.FileSystemObject. i.e. Code: Dim FSO As FileSystemObject Set FSO = New FileSystemObject If FSO.FileExists("<path to file") Then ' Code on existence of file. End If HTH John Whyte jwhyte@skipton.co.uk