Thread: 'Kill'
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default 'Kill'

This was posted by Jim Rech:


Sub testme()


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


End Sub



--
Don Guillett
SalesAid Software

"solomon_monkey" wrote in message
ups.com...
Hi,

I've read and re read many posts on this subject- I do not want to
delete the file to the recycle bin just remove it completely so am
using...

Sub DeleteThisFile()

Dim DeleteFile As String

DeleteFile = ActiveWorkbook.FullName

ActiveWorkbook.Close
On Error Resume Next
kill DeleteFile

End Sub

The user need not know that the fiule is being deleted... however when
trying to run it I get the following 450 error

'Wrong number of arguments or invalid property assignment'

Am I missing something dreadfully obvious? It has been a long day...
Thanks