+ Reply to Thread
Results 1 to 2 of 2

Failure of Dir function

  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    Madison, WI
    MS-Off Ver
    MS Office 2010 (Excel, Word, Access)
    Posts
    72

    Failure of Dir function

    I've got a boatload of file names that I need to update, and I was trying to do so using the Dir function.

    What's weird is that, for some reason, "Dir" is currently returning Error Code 5, "Invalid procedure call or argument."

    My code follows; any ideas why it's causing me trouble?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Failure of Dir function

    You're treating the Dir as a variable instead of a function.

    Please Login or Register  to view this content.
    Also, your declaration of the global variables are not all strings. The first three are Variant, while the last one is a String.

    To correctly declare all as Strings:
    Please Login or Register  to view this content.
    Last edited by Tinbendr; 01-29-2015 at 04:07 PM.
    David
    (*) Reputation points appreciated.

+ 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. [SOLVED] Time of day Vs Failure
    By karl8695 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-31-2013, 06:07 AM
  2. Autofill failure
    By nemec7 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-23-2007, 02:19 PM
  3. sumproduct failure?
    By Herman56 in forum Excel General
    Replies: 3
    Last Post: 03-30-2006, 11:25 AM

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