Turn off ALL warnings question?

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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
 
Back
Top