Output to xls and overwrite

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

Guest

Is it possible to use the "output to" command in a macro and have it
automatically overwrite the existing file instead of asking if it's ok to
overwrite? Thanks.
 
I never use macros, so I'm not sure whether it's possible, but see whether
you can check if the file exists (use the Dir function, and delete it if it
does.

It would be pretty simple to do this in VBA:

strFile = "C:\...\file.xls"
If Dir(strFile) > 0 Then
Kill strFile
End If
 
Back
Top