#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default RmDir

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,



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default RmDir

Charlotte,

All the methods can be found here

http://www.rondebruin.nl/folder.htm#Delete

Mike

"Charlotte E" wrote:

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,




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default RmDir

Use the FSO object..

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

If this post helps click Yes
---------------
Jacob Skaria


"Mike H" wrote:

Charlotte,

All the methods can be found here

http://www.rondebruin.nl/folder.htm#Delete

Mike

"Charlotte E" wrote:

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,




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FileSystem.RMDIR bill_morgan Excel Programming 2 September 17th 05 05:35 PM


All times are GMT +1. The time now is 08:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"