Results 1 to 3 of 3

Thread: Creating Directories

  1. #1

    Thread Starter
    Hyperactive Member Steve Stunning's Avatar
    Join Date
    Jul 1999
    Location
    Fairfax, Virginia
    Posts
    314

    Question

    Task:
    I need to create a temp directory for files to be stored in.

    Knowledge:
    I know about MkDir and RmDir.

    Problem:
    I am not allowed to create a directory if it already exists. I would like to have a way to verify the directory needs to be created.

    Thank you for reading this
    Steve Stunning

  2. #2
    Guest
    Use the Dir function to check if a folder exists.

    Code:
    If Dir("C:\MyDir", vbDirectory) = "" Then
    MkDir "MyDir"
    Else
    Msgbox "Directory already exists!", vbCritical, "Error:"
    End If

  3. #3

    Thread Starter
    Hyperactive Member Steve Stunning's Avatar
    Join Date
    Jul 1999
    Location
    Fairfax, Virginia
    Posts
    314

    Talking

    Matthew Gates

    Once again you have come to the rescue.

    THANKS!! That works just fine. I never knew about the vbDirectory portion of the command. I learned something new today.
    Steve Stunning

Posting Permissions

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



Click Here to Expand Forum to Full Width