+ Reply to Thread
Results 1 to 4 of 4

searching folder for existing file

  1. #1
    Registered User
    Join Date
    11-26-2008
    Location
    New England
    MS-Off Ver
    2007
    Posts
    35

    searching folder for existing file

    Here's another one:
    I need to check if a file already exists in a folder, and prompt the user to choose if they want to overwrite it.

    I've found some posts that dal with getting filenames, but haven't found one that addresses this.

    Thanks again!
    Ted

    Please Login or Register  to view this content.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    try this code
    The ActiveWorkbook.SaveAs command id from your code the rest is from me so you will probally need to tinker with the variable names, file paths

    The msgbox is your wording with buttons set by me - you may want to change it to suit

    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.

  4. #4
    Registered User
    Join Date
    11-26-2008
    Location
    New England
    MS-Off Ver
    2007
    Posts
    35

    Re: searching folder for existing file

    Mudraker:
    (just getting back to this....)

    This code works EXCEPT when the file already exists in the folder. I'd like be able to choose not to overwrite the file without it kicking me out of the macro.

    This was my attempted solution, but it didn't work. I'm still getting the "regular" saveas dialog prompt. Is there anyway to skip this? I didn't see anything in the help file about using true/false....

    Ted

    Please Login or Register  to view this content.

+ 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