RmDir

C

Charlotte E

I'm trying to remove/delete a directory, that I use for storing some
temporary files, using:

RmDir DestinationPath


Problem is that it doesn't work, if the folder contains files?!?

What's the point of that?!? Only reason to delete a directory at folder
level is excately to avoid deleting a great number of files, one by one!

Anyway, how do I delete a directory from VBA, which contains files?


TIA,
 
J

Jacob Skaria

Use the FSO object..

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder DestinationPath

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top