Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default delete folder

I'm using kill function to delete files. I'm having trouble using this to
delete folders. Can I use this to delete folders or is there a better way?

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

The folder must be empty first

Sub getrid()
On Error Resume Next
RmDir "C:\Myfolder\"
On Error GoTo 0
End Sub

Mike

"Chad" wrote:

I'm using kill function to delete files. I'm having trouble using this to
delete folders. Can I use this to delete folders or is there a better way?

Thanks,
Chad

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default delete folder

Perfect, thanks!!


"Mike H" wrote:

The folder must be empty first

Sub getrid()
On Error Resume Next
RmDir "C:\Myfolder\"
On Error GoTo 0
End Sub

Mike

"Chad" wrote:

I'm using kill function to delete files. I'm having trouble using this to
delete folders. Can I use this to delete folders or is there a better way?

Thanks,
Chad

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default delete folder

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

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Chad" wrote in message ...
I'm using kill function to delete files. I'm having trouble using this to
delete folders. Can I use this to delete folders or is there a better way?

Thanks,
Chad

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default delete folder

Note that RmDir requires that the folder be empty and then the deletion of
the folder is total and unrecoverable. I would recommend you use the Recycle
Bin which allows you to delete folders that are not empty and puts them in
the recycle bin so they can be restored, just in case. See
www.cpearson.com/Excel/Recycle.htm for example code.




"Chad" wrote in message
...
I'm using kill function to delete files. I'm having trouble using this to
delete folders. Can I use this to delete folders or is there a better
way?

Thanks,
Chad


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
Delete File in a folder Les Stout[_2_] Excel Programming 4 March 3rd 06 01:20 PM
Create / Delete folder loopoo[_20_] Excel Programming 2 December 6th 05 02:25 PM
Delete Folder Todd Huttenstine Excel Programming 2 August 22nd 04 04:20 AM
delete folder Janelle Excel Programming 3 February 5th 04 08:51 PM
fso delete folder shockley Excel Programming 5 December 24th 03 04:43 PM


All times are GMT +1. The time now is 11:51 PM.

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

About Us

"It's about Microsoft Excel"