+ Reply to Thread
Results 1 to 2 of 2

create a folder in c:\

  1. #1
    Registered User
    Join Date
    04-28-2004
    Posts
    20

    Question create a folder in c:\

    is it possible to have a macro create a folder named myfolder in c:\?

    in case, a folder named myfolder already exists in c:\, then it should not overwrite. the folder should be created only if it doesn't exist.

    can anyone help, please!

    TIA.

  2. #2
    Registered User
    Join Date
    10-14-2003
    Posts
    7
    You need a FileSystemObject to do this. Declare for example like this

    Dim FilSysObj As Scripting.FileSystemObject

    then

    Set FilSysObj = New Scripting.FileSystemObject

    You can then use the Createfolder function

    FilSysObj .Createfolder ("YourPath")

    The statement will not overwrite en exisiting folder with the same name. To prevent error msg in case the folder already exist use

    on error resume next

    before you create the folder

    Remember to use Microsoft scripting Runtime something in Tools --> References
    Last edited by hke; 03-02-2005 at 10:57 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1