Replace existing file message.

J

Joe Cochran

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?
 
A

Aurora

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?
 
D

Douglas J. Steele

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
 

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

Top