Re: Unable to delete folder



Help - Kill - See Also.

RmDir Statement

Syntax

RmDir path

The required path argument is a string expression that identifies the
directory or folder to be removed. The path may include the drive. If no
drive is specified, RmDir removes the directory or folder on the current
drive.

Remarks

An error occurs if you try to use RmDir on a directory or folder containing
files. Use the Kill statement to delete all files before attempting to
remove a directory or folder.

This example uses the RmDir statement to remove an existing directory or
folder.

' Assume that MYDIR is an empty directory or folder.
RmDir "MYDIR" ' Remove MYDIR.

Cheers,
Alan

"biganthony via AccessMonster.com" <u31673@uwe> wrote in
727d4bfe8f481@uwe:">news:727d4bfe8f481@uwe:

Hi,

I have the following code to select a folder and then delete it. I
keep getting a Path/File error on the line that deletes the actual
folder. The line before that line deletes the files in the folder but
I get the error message when the procedure attempts to delete the
folder selected in the BrowseforFolderbyPath function.

How can I get it to delete the folder that the user has selected in
the Browse for Folder dialog?


Thanks,
Anthony

.



Relevant Pages

  • Re: Delete folder
    ... If the directory is empty then RmDir works fine. ... If the directory has files then you need to Kill all ... The API has it is own error handling. ... > Is there any built-in function in VB6 that allows me to delete a folder on ...
    (microsoft.public.vb.general.discussion)
  • Re: Importing and Appending Multiple Excel workbook data into Acce
    ... This is very cool....I have tried both and the kill process is a neat one... ... Try this code to do the import.- replace the Const ... Dim myXLS As String ... snag a folder full of imports. ...
    (microsoft.public.access.externaldata)
  • Re: Contacts Folder
    ... "Kill" wrote in message ... > Outlook and Activesyn for my pocketpc haven't been playing well lately. ... >> the one that says "Folder List?" ... >> Russ Valentine ...
    (microsoft.public.outlook.general)
  • Re: Many File Import
    ... copy the files you want into a temporary folder and import them from ... there (with the Kill statement), ... >>Please respond in the newgroup and not by email. ...
    (microsoft.public.access.externaldata)
  • Re: Enquiry for Ron de Bruin
    ... I tried to Kill the file in the zip but it came up with no file found. ... It is not possible to hide the copy dialog when you copy to a zip folder. ... Also there is no possibility to avoid that someone can cancel the CopyHere operation or that your VBA code will be notified that the operation has been cancelled. ... As this is to be done over a VPN connection, the time involved and the chances of a problem with the connection increases greatly. ...
    (microsoft.public.excel.programming)