View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Deleting a file on C drive using VBA

Actually, you can kill that open workbook:

This was posted by Jim Rech:

Sub testme()

With ThisWorkbook
.Saved = True
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With

End Sub

(make sure you have backups!)



Pete McCosh wrote:

Todd,

The Kill command wont work if you have the file you want
to kill open, as I presume you must have, otherwise you
couldn't close it!

Pete


--

Dave Peterson