I’ve run into the same error and here’s what I think the problem is:
If you were to manually attempt to delete a file such as C:\test.txt, you’d get the following error message:
File Access Denied
You’ll need to provide administrator permission to delete this file
So when excel VBA tries to delete a file in the root directory, I think it also gets an error message.
For me, at least, that seems to be the cause of the problem.
If anyone out there knows how to programmatically give VBA permission to delete a file in the root directory, I’d be grateful.
Hopefully, this post will help to get us all on the right track.
Regards,
Kellog