• VBA creating folders (Offcie 2003 NL)

    Author
    Topic
    #441481

    Hello all,

    I have an Excel document with some VBA that is creating some new Excel documents and is storing them in some folders.
    The folder and file names are stored in an array and to overcome errors I check if the folder exists ( fs.folderexsists(fldrarry(n)) ), and if it isn’t then I creat the folder.
    The problem I have is that if the path consists of more folders e.g. “C:/folder1/folder2/folder3” and folder2 and folder3 don’t exists it is not possible to create them at ones with the command: fs.createfolder(fldrarray(n))
    How could I sove this problem easy?

    Thanks in advance for your reply.

    Viewing 0 reply threads
    Author
    Replies
    • #1060250

      See the CheckFolder procedure in post 643,607. It checks each part of the specified path and creates it if necessary.

      • #1060254

        Cool Hans,
        Quick answer and it is working (ofcourse)

        • #1060261

          It’s pure coincidence that someone else asked exactly the same question very recently.

    Viewing 0 reply threads
    Reply To: VBA creating folders (Offcie 2003 NL)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: