+ Reply to Thread
Results 1 to 4 of 4

Check if Directory is Empty and Provide Message

  1. #1
    Forum Contributor
    Join Date
    11-28-2005
    Location
    Dover, England
    MS-Off Ver
    365
    Posts
    172

    Check if Directory is Empty and Provide Message

    I have adapted a wonderful bit of code to fulfil the renaming of my files however, when it runs it crashes if a the directory has nothing in it. Can some one advise/adapt the code to identify the directory is empty, display a message informing me that it is and go back to the browser.

    Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Check if Directory is Empty and Provide Message

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor
    Join Date
    11-28-2005
    Location
    Dover, England
    MS-Off Ver
    365
    Posts
    172

    Re: Check if Directory is Empty and Provide Message

    Patel many thanks for this. Is there any way it can check for a specific file type within the directory i.e. PDF and if this = 0 then provide the message?

    Thanks

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Check if Directory is Empty and Provide Message

    I'm sorry but Application.FileSearch is not implemented on excel 2010, check on help, maybe you have to change

    .FileType = msoFileTypeAllFiles 'get all files

+ 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