Showing posts with label Delete the entire folder using VBA. Show all posts
Showing posts with label Delete the entire folder using VBA. Show all posts

Thursday, January 01, 2009

How to delete Folder using VBA

VBA RmDir Method


Here is a simple method to delete the entire folder using VBA

Sub Delete_Folders_FS()

Dim sFolder As String

On Error GoTo Err_Msg

sFolder = "c:\temp\2Bdeleted\"

RmDir (sFolder)

Err_Msg:

If Err.Number <> 0 Then

MsgBox Err.Description

Err.Clear

End If

End Sub

Related Posts Plugin for WordPress, Blogger...
Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.