View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
BBert[_2_] BBert[_2_] is offline
external usenet poster
 
Posts: 8
Default Routine for checking if file exists

On Wed, 26 Jan 2005 18:57:59 GMT, Centurion wrote...

1) how do I test (within VBA) to see if the file exists.


Sub FileExists()
Dim fFileExists As Boolean

fFileExists = (Len(Dir("C:\config.sys")) 0)
If fFileExists = True Then
msgbox "File Exists"
Else
msgbox "No File Found"
End If
End Sub

--
Met vriendelijke groeten / Mit freundlichen Grüßen / With kind
regards/Avec mes meilleures salutations
BBert

April 20, 1986
Celtics (135) - Bulls (131)
Larry Bird: "God disguised as Michael Jordan"