Delete a file

johanhjalmarsso

Registered User.
Local time
Today, 04:10
Joined
Jul 12, 2005
Messages
26
Hi!

I just want to delete a file with VBA. Like this: Deletefile "c:\blabla.txt"

But deletefile function needs some kind of object and I don't want that. Just to delete a file. How can i do this?
 
I figured it out by a search on google.
I should not use deletefile method. I should use kill.
Kill takes a string as argument and deletes it.
 
Same answer... just use: Killl "c:\blabla.txt"
This method will produce an Error 70 if the file to delete is blocked or opened, think you need an error handler.
 

Users who are viewing this thread

Back
Top Bottom