Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Creating & deleting file folders

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    In my application I have to use a folder temporary (thus called TEMP). After use I like to delete this folder.
    Is it possible in Excel VBA to create and delete a file folder?

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    Which version of office are you using?
    Tom

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Wellington
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,

    You can try using the following:

    to create folders:
    mkdir "C:temp"

    and to delete folders:

    rmdir "c:temp"

    HTH

  4. #4
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-26 18:16, BabyTiger wrote:
    Hi,

    You can try using the following:

    to create folders:
    mkdir "C:temp"

    and to delete folders:

    rmdir "c:temp"

    HTH
    BabyTiger the rmdir won't work if the Dir
    has files in them....you can do this though

    Sub RemoveDir_WithFiles()
    Dim Fs As Object

    On Error GoTo DelErr
    'CAUTION: Will delete entire Folder NO PROMPT
    Set Fs = CreateObject("Scripting.FileSystemObject")
    Fs.DeleteFolder "C:mydir", True

    Exit Sub
    DelErr:
    MsgBox Err.Number & vbCr & _
    Err.Description
    End Sub



    Ivan

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •