You should give the OS time to actually finish the kill e.g.
Code:
Kill "Your temp file.tmp"
DoEvents 
Sleep(1000) 'wait a second or so, 1000 milliseconds = 1 second
Maybe this will help.