DoCmd.TransferSpreadsheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a (preferably) simple way to get access to prompt if the file
already exists, rather than it just simply over writing the existing file??

Thanks
 
Try the File Search command:

With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents"
.SearchSubFolders = True
.FileName = "Run"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
End With
 
If Dir("F:\SomeDirectory\SomeFile.xls") <> "" Then
MsgBox "File Already Exists"
End If
 
Thanks Kevin but Klatuu's was simpler :-)

Kevin said:
Try the File Search command:

With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents"
.SearchSubFolders = True
.FileName = "Run"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top