View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Curt Curt is offline
external usenet poster
 
Posts: 469
Default check if file exists

Thanks much will get at it

"Steve" wrote:

this should get you started:

Function FileExists(fName) As Boolean
' True if exists
On Error GoTo FileExists_Error

FileExists = False

Dim x As String
x = Dir(fName)
If x < "" Then FileExists = True

Exit Function

FileExists_Error:
Select Case Err.Number
Case 52
FileExists = False
Case Else
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in
procedure FileExists "
End Select
End Function


"Curt" wrote in message
...
Need help vba code to take input from save as dia box check if that file
exists if does reject that filename. then ask for diff name.