View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Boicie[_7_] Boicie[_7_] is offline
external usenet poster
 
Posts: 1
Default Kill statement problems

Using the Kill command that way, you are trying to delete a workboo
that is open. Which is not possible.

You'll need to close it first, then delete it which can be achieve
using the following code which stores the file path into variable 'x
and changes two of your lines of code around to close it first, the
deletes the file indicated by 'x'.


Sub Newe()
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs ("The File.xls")
.SendMail ", Subject:= _
"Your file"

x = .FullName
.Close False
Kill x

End With
End Sub



Regards,

Boici

--
Message posted from http://www.ExcelForum.com