Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check to see if a value exists in a list? Pradhan Excel Worksheet Functions 6 April 2nd 23 06:35 PM
Check if file exists Jon Excel Discussion (Misc queries) 14 October 4th 07 04:57 PM
How to check if a file exists in an ftp folder LL Cool A Excel Discussion (Misc queries) 3 May 16th 06 09:22 PM
How check for No/Cancel Button when SaveAs and file already exists? Joe HM Excel Programming 7 April 19th 05 10:53 AM
check if a file exists / is open Mark Kubicki Excel Programming 1 December 4th 03 05:56 PM


All times are GMT +1. The time now is 06:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"