Replace existing file message.

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

Guest

I have a macro that sends a query to Excel. Each time it runs, I get a
message stating the file already exists and do I want to replace it. Is there
a way to have the question answered Yes automatically?
 
Does anyone have an answer to this question? I also have the same problem.
Furthermore, I would like the excel spreadsheet to close automatically and
run the next line in my macro in access. How can I accomplish this without
the need of any user response?
 
Rather than using a macro, use VBA. In the VBA, check to see whether the
file exists, and delete it if it does.

strFile = "C:\Folder\File.xls"
If Len(strFile) > 0 Then
Kill strFile
End If
 
Back
Top