Rolling back 'folders delete' using VBA
The best way would be to not delete anything, but to build an array of all
deletable files. When you get the error, just quit, if you don't, iterate
the array and delete them all.
--
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"Nayan" wrote in message
...
Hello,
(Environment Excel 2003) (operating system Windows XP professional)
I am deleting a root folder in a vba macro using filesystem object. This
root folder has many subfolders in it.
If any of the files (any type of the file) in any subfolder can not be
deleted for any reason (such as if file is read only or already opened in
an
application) then I get 'permission denied' error. At this point I want to
rollback the entire deleting process.
Basically on any type of error while deleting the root folder I want to
rollback the deleting process.
Any ideas or suggestion as how this can be achieved programmetically in
Excel macro.
Thanks in advance
Nayan
|