+ Reply to Thread
Results 1 to 4 of 4

Checking if file name already exists

  1. #1
    Rob T
    Guest

    Question Checking if file name already exists

    Right, this is the code I have which generates a Bill of Materials (BoM) in a different format from our BoM. The code which actually does the copying across I haven't included as it's not particularly relevant (that's the "sub CopyData"). The only problem with this code is that if you enter a filename which already exists and (at the relevant time) click "no" to the overwrite option the macro crashes out.

    Is there any way to check when the user first enters the file name whether it is the same as another file in that folder?

    Many thanks in advance,

    Rob

    HTML Code: 

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    This wil test if the file exists

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Rob T
    Guest
    Thank-you very much mudraker, works like a charm!

    Cheers,

    Rob

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Glad to hear that it helped you solve your problem

+ 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