+ Reply to Thread
Results 1 to 4 of 4

Directory checking and creation

  1. #1
    Registered User
    Join Date
    08-15-2008
    Location
    London
    Posts
    11

    Directory checking and creation

    Hi all,

    Having a bit of trouble with a line of code I'm trying to write. Basically I want it to check if a directory on the server exists, and if it doesn't, create that folder. That part works fine. The problem I'm having now is with the next check on the sub-directory.

    The first line of code I have is:

    Please Login or Register  to view this content.
    ... and that works fine. The next line always gives me a "Compile Error: Expected: expression":

    Please Login or Register  to view this content.
    I'm fairly sure it's how I'm trying to include the sub-directory with the backslash after the first "yyyy"), but I can't find a way to do it! In plain English, it needs to look for\Debt Reports\Dispute Reports YEAR\MON YEAR and then another sub-directory check after that one. If someone can help me with the above I know I can do the rest, just stuck on this one bit!

    Many thanks for any and all suggestions!

    Peter

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Directory checking and creation

    Are you trying to include the mmm yyy in the path/folder you are checking?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    08-15-2008
    Location
    London
    Posts
    11

    Re: Directory checking and creation

    Hi Norie,

    That's correct. So if I wanted to run it today, I would expect it to be looking for:

    \\ukuxhqfs01\dispute$\Debt Reports\Disputes Reports 2014\Nov 2014

    Thanks,

    Peter

  4. #4
    Registered User
    Join Date
    08-15-2008
    Location
    London
    Posts
    11

    Re: Directory checking and creation

    Hi Norie,

    That worked beautifully! Thank you!

    Can't believe I missed out the extra ampersand and quotes!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 09-05-2013, 10:00 AM
  2. [SOLVED] Excel macro request for Directory Creation & Moving files
    By ganeshinscribe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-25-2012, 10:03 AM
  3. creation of directory fails due to invalid characters
    By HarryKlein in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-13-2012, 11:44 AM
  4. Excel file creation dates do not match the windows creation date.
    By alexthapyro in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2011, 12:14 PM
  5. Checking and opening excel files that begin with specific string in a directory
    By ranuse in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2010, 03:42 PM

Tags for this Thread

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