• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Releasing A Folder Once It's Deleted

I'm using:


Kill "C:my_folder*.*"

RmDir "C:my_folder"


My question and problem is you can still see the folder visible after this code is ran (even though it's deleted), but after I close the workbook it finally disappears.


How do I release the folder so that it instantly deletes and disappears (because Excel is attached to it some way).


This situation is similar to an open file or folder you can't quite delete yet because it's busy.


Of course I can run a code to close and reopen my workbook to release the folder (and then it disappears), but I would really prefer avoiding closing & reopening if all possible.


Does anyone have any other suggestions to release this folder so that it instantly deletes and disappears?
 
I found it was File Scripting Object stuff that was locking my folder.


If you use this at the very end of your code to distract it away from other folder you're good.


Dir ("c:temp*.*")


Resolved ; ) I hope this helps someone out.
 
Back
Top