Turn off ALL warnings question?

G

Guest

Does anyone know a way to turn of all warnings when using the Output to
feature of a macro? I am trying to out but query results to a specific excel
file. I always want to overwrite the current file but do not want to have to
answer the question" File X already exists. Overwrite?" I tried using the
Set warnings feature but that does not include this message. Any thoughts?
 
B

Brian Wilson

Steve said:
Does anyone know a way to turn of all warnings when using the Output to
feature of a macro? I am trying to out but query results to a specific
excel
file. I always want to overwrite the current file but do not want to have
to
answer the question" File X already exists. Overwrite?" I tried using
the
Set warnings feature but that does not include this message. Any
thoughts?


Why not first delete the file yourself if it exists?

If Len(Dir(strPath))>0 Then
Kill strPath
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