Similar to SetWarnings, file output prompt to YES

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

Guest

In a macro, is it possible to set the answer to always be YES?, when you get
the prompt "The file 'C:\[filename].xls' already exists. Do you want to
replace the existing file?"?

Like you can with "SetWarnings", is it possible to do the same with file
output in a macro?
 
Kevin,

No, this is not possible. As far as I know, the only way to avoid this
confirmation prompt is to delete the file first. Macros do not provided
the means to do this directly. You would need to do it in VBA using the
Kill method. So, your options would be to use a VBA procedure for the
whole process, or to delete the file in a VBA function, and then use a
RunCode action in your macro to run the delete from there.
 
Back
Top