VBA delete all files in a Folder
Posted on 2013-06-27
I have a folder called P:\Pix
I want to delete every file in that folder
I am using the following code:
Dim dbs As Database
Dim fs, f, s, Folder
Set fs = CreateObject("Scripting.FileSystemObject")
Set Folder = fs.getfolder("P:\Pix")
I get an error message "Access Denied" if the folder is not empty.
Question: How do I delete every file in that folder?
Help is appreciated