View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Stephen Stephen is offline
external usenet poster
 
Posts: 106
Default if workbooks exists delete

brilliant! thank you much!!!

"Jim Thomlinson" wrote:

Try just setting
appliation.displayalerts = false

just prior to the save. Taht will stop the alert message. Set it back to
true when the save is complete

Application.DisplayAlerts = false
ThisWorkbook.SaveAs "C:\Tada.xls"
Application.DisplayAlerts = true
--
HTH...

Jim Thomlinson


"Stephen" wrote:

Hi Folks,

I have a simple little problem where before my macro create a temp file by a
certain name, I want it to check if that file already exists and if it does,
delete it.

I have code that will delete the temp file as one of the finishing touches
on the procedure, but occasionally the program won't run all the way through
and upon autorecovery it needs user input asking if you want to overright the
existing file. I'd rather simply check for it and remove it if exists before
getting to that point.

TIA!