I'm using Dir function to get directory's content right now.
FileSpec = DirPath & "/GenerateID_*_*.zip"
FileName = Dir(FileSpec)
But Dir function is locking the folder and can't delete that folder until I close my VBA application. I have tried ChDir("C:\")
to make this point to another directory after calling Dir function but it's not working.
Is it possible to filter using FileSystemObject like Dir function? Or get all files with FileSystemObject, loop each fileName and checking each one would be the only option?