+ Reply to Thread
Results 1 to 3 of 3

How to handle an error of Name function:confused:

  1. #1
    Registered User
    Join Date
    09-16-2018
    Location
    Israel
    MS-Off Ver
    2013
    Posts
    15

    Wink How to handle an error of Name function:confused:

    Please advise - I wrote a code in VBA that iterates through files in certain directory, rename them, and write the status to Excel. I would like to edit the code so that if the command Name returns error (For example if NewFileName already exists), then the parameter status would be "Fail", and continue to the next iteration. Could anyone help me how to do so?



    Please Login or Register  to view this content.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to handle an error of Name function:confused:

    Hi, you can use the DIR command to see if the file exists

    Please Login or Register  to view this content.
    Hope this helps a little
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    09-16-2018
    Location
    Israel
    MS-Off Ver
    2013
    Posts
    15

    Re: How to handle an error of Name function:confused:

    thanks ))))

+ 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] confused about Sum Error #VALUE
    By Learning ExL in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 04-17-2015, 12:07 PM
  2. [SOLVED] confused about runtime error
    By a.hudrea in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2014, 05:33 AM
  3. [SOLVED] Best way to handle if error with call function
    By rpinxt in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-21-2013, 08:00 AM
  4. 1004 Error due to nasty server - unable to error handle
    By PuppyOnTheRadio in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2013, 06:39 AM
  5. Replies: 1
    Last Post: 10-03-2012, 10:32 PM
  6. [SOLVED] Macro executes but not giving results :confused::confused::confused:
    By Ganesh7299 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2012, 10:49 AM
  7. How to handle error 8007000e Memory Error
    By L. A. M. in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-27-2005, 11:05 PM

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