output to action file overwrite

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

Guest

I have a macro with an "output to" action to send the data to an .xls file. I
have a file path and name in the "ouput file" parameter. I scheduled this
macro to run in the scheduler. Works well except when I accidently already
have a file of the same name in the folder and the scheduled run at night is
waiting for me to hit the 'yes' or 'no' button to over write the file. Is
there a switch or an option I can set up in the macro to always overwrite if
found a file with the same name in the folder already?
 
You need to check whether or not the file already exists, and delete it if
it does.

To check whether a file exists, you can use the Dir function around its
name: Dir will return a non zero-length string if the file exists.
 
Back
Top