VB - How do I check if specified file exists

  Newuser3443 15:49 11 Oct 05
Locked

I am using VB 6.3 and am using the following code.

My intention is to exist the proramme if no file name is entered, loop back to request the filename again if an invalid one is entered or continue if the filename is valid........

Filename = ""
Do While Filename = ""
Filename = InputBox("Please enter filename")
If Filename = "" Then End
If File.Exists(Filename) Then
MsgBox ("File found.")
Else
MsgBox ("File not found.")
Filename = ""
End If
Loop


The line If File.Exists does not work however. Can someone please explain what I'm doing wrong.

Thanks in advance for any assistance.

Rob

This thread is now locked and can not be replied to.

Best phone camera 2016/2017: Galaxy S7 vs iPhone 7 vs Google Pixel vs HTC 10 Evo vs OnePlus 3T vs…

1995-2015: How technology has changed the world in 20 years

These are the Best Christmas Ads and Studio Projects of 2016

Super Mario Run preview | Hands-on first impressions of Super Mario Run: Mario's iPhone & iPad…